Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Two issues here:

1) Sage is trying to evaluate the sum command as if it is a Python expression. So, to turn it into a function, you can do:

f=lambda x: add([.25^(100-i) * .75^(i) * binomial(100,i) for i in range(0, x)])

2) The plot command tries to plot at non-integer points, so your command will not plot. You can try the following:

pts=[point([x,f(x)]) for x in range(1,101)]
p=add(pts)
show(p)