2
$\begingroup$

I've seen other questions and tried to use internet and the built-in help but I'm still at a loss.

Given the sequence seq((n,1/2^n),n..20)), I want to plot the corresponding sequence of partial sums, but I can't figure out how.

I have:

with(plots):
PartialSums([seq(1/2^n, n = 1 .. 20)]) 

And that gives me the sequence, but how do I plot it with respect to n?

$\endgroup$
4
  • $\begingroup$ Does this help? web.clark.edu/jmitchell/maple/Sequences%20in%20MAPLE/… $\endgroup$
    – apnorton
    Sep 13, 2013 at 0:11
  • $\begingroup$ I saw that one but it mostly just confused me. This is making me feel really dumb. $\endgroup$
    – Daniel B.
    Sep 13, 2013 at 0:25
  • $\begingroup$ That page also does series as just a solution, not a plot of the sequence of partial sums. It plots a sequence, but that returns different values than PartialSums (the function I tried, which returns a list containing the partial sum for each n in the range) $\endgroup$
    – Daniel B.
    Sep 13, 2013 at 0:27
  • $\begingroup$ incidentally, googling "maple "partialsums" plot" brings up this page as the first hit XD $\endgroup$
    – Daniel B.
    Sep 13, 2013 at 0:36

1 Answer 1

3
$\begingroup$
L := ListTools:-PartialSums([seq(1/2^n, n = 1 .. 20)]):

plots:-listplot(L);
$\endgroup$
3
  • $\begingroup$ That is very close to what I need, but I need discrete points ... $\endgroup$
    – Daniel B.
    Sep 13, 2013 at 1:06
  • $\begingroup$ You can add any usual plot option into the mix. For example, 'style=point' can be put into that call to 'listplot', and so on. Issue the command ?plot,options will show a help page. $\endgroup$
    – acer
    Sep 13, 2013 at 1:46
  • $\begingroup$ You are my new best friend :) $\endgroup$
    – Daniel B.
    Sep 13, 2013 at 1:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .