Group Abstract Group Abstract

Message Boards Message Boards

0
|
9.9K Views
|
9 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

What is the syntax error in this expression?

Posted 10 years ago

In[33] was copied and pasted from the Mathematica language syntax tutorial, which evaluates as expected from the tutorial. In[34] is my attempt to type this symbolically myself, which gives a syntax error/incomplete expression. The only visible difference to me is that the letters "n" are both gray in the correct expression, but they are blue in the incorrect one. I assume this means they are somehow linked in the former, but I don't know how to reproduce this. New to Mathematica language, thanks in advance for help!

Attachments:
POSTED BY: Rose Yntema
9 Replies
Posted 10 years ago

Ahh! As I said, I am extremely new to this and am just beginning with the built-in tutorials; I didn't actually know about the palette yet. I thought I had to enter fancy expressions using only keyboard shortcuts, silly me. When I use the palette it works fine, since it has explicitly delineated fields for the index and expression. I just couldn't figure out how to impart this information using only shortcuts but now I know I don't have to.

Thank you all very much!

POSTED BY: Rose Yntema

Looks like the palette wasn't used to construct the expression.

POSTED BY: Frank Kampas

What happens if you enter the expression as

In[2]:= Sum[n^-s, {n, 1, \[Infinity]}]

Out[2]= Zeta[s]

?

POSTED BY: Frank Kampas
Posted 10 years ago

To get after what Frank recommended I copied and pasted each command (the bad and the good) into a text editor and found the following:

Bad one

\!\(\*UnderscriptBox[
OverscriptBox[\(\[Sum]\), \(\[Infinity]\)], \(n = 1\)]\)1/n^s




Good one

\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(n = 1\), \(\[Infinity]\)]
\*FractionBox[\(1\), 
SuperscriptBox[\(n\), \(s\)]]\)
POSTED BY: Jim Baldwin
Posted 10 years ago
Attachments:
POSTED BY: Rose Yntema

I suggest you look at FullForm of the expression that doesn't work to figure out what's going on. enter image description here

POSTED BY: Frank Kampas
Posted 10 years ago

Here is a screenshot of each expression in a new, clean notebook. I am trying to figure out why the sum I type will not evaluate, but the sum I copy-paste from a tutorial does evaluate to the correct Zeta[s] output.

Attachments:
POSTED BY: Rose Yntema
Posted 10 years ago

The Zeta was just the evaluation of the expression (output). It's not anything I typed. I had another notebook file where I typed my sum expression first and it didn't work then either.

POSTED BY: Rose Yntema

I'm no coder but....I think it's because you put: Zeta[s] instead of: s = Zeta[n]...I might be wrong, but it seems like that to me.

POSTED BY: Joshua Champion
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard