# Plotting a finite series w.r.t. a parameter [closed]

So I would like to plot the series below:

$$S_q = k \frac{1-\sum_{i=1}^{W}(1/W)^q}{1-q}$$

where $k$ is a constant which I assume for now to be equal to 1 and $q \in \mathbb{R}$. However, for my problem $q$ takes integer values such that $q \in [-2,3]$.

I do not know how to plot a series with Mathematica and a series with a parameter is even more daunting. I have tried out some coding but I cannot get the result right.

If anyone could assist me with this one I would be grateful.

• @JohnConorCosnett Weel, tbh I really do not know how to proceed. I mean I looked up the documentation but I am not able to find out how to plot this series. :/ – Mitscaype Jan 30 '16 at 12:17
• (I'm only a physics undergrad with a smattering of logic) If q is an integer AND is an element of the interval -2,3 inclusive. THEN there must be a separate plot for: q = {-2, -1, 0, 1, 2, 3} ? – Conor Cosnett Jan 30 '16 at 12:38
• @JohnConorCosnett But $q$ is a real parameter. It defines a new series for each value it takes. Then we plot the six results, one for each $q$ in the same graph. Not in separate ones. – Mitscaype Jan 30 '16 at 12:48
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! – Michael E2 Jan 30 '16 at 13:02
• No problem. Just trying to help. :) -- Formatting code is done by putting it between back-ticks. See also the ? in the edit window (of a question or answer -- comments don't have help) for more formatting help. – Michael E2 Jan 30 '16 at 17:06

Perhaps this is will work for you.

s[1, n_] = 0;
s[q_, n_] := (1 - Sum[1/w, {w, 1, n}])/(1 - q)

tbl = Flatten[Table[{q, n, s[q, n]}, {q, -2, 3}, {n, 1, 5}], 1];
ListPlot3D[tbl, Mesh -> {5, 5}, AxesLabel -> {"q", "n", "S"}] or perhaps

ListPointPlot3D[tbl, Filling -> Bottom, AxesLabel -> {"q", "n", "S"}] • Thank you! But still,how am I able to get a $(S_q, w)$ plot? – Mitscaype Jan 30 '16 at 15:00
• @Mitscaype. I think what you are calling W, I have renamed n. – m_goldberg Jan 30 '16 at 15:17
• You are right. Thank you so much. That solved my problem! But I have one last question. All of this has to do with statistical mechanics and therefore later on, I will have to plot this kind of quantities alongside with probabilities. But then it gets complicated, find the probabiltiy which corresponds to each $n$ etc. Any good ideas where I could get material on how to make such plots? Thank you again! – Mitscaype Jan 30 '16 at 15:31
• @Mitscaype. As for your additional question concerning probabilities, I suggest you ask a new question about that on this site when you are ready extend your work in that direction. – m_goldberg Jan 31 '16 at 5:54
• Ok then! Will do :) Thank you once again! – Mitscaype Feb 1 '16 at 15:58