Ask Your Question

Ducky47's profile - activity

2021-01-13 14:45:03 +0200 received badge  Popular Question (source)
2017-09-19 19:18:44 +0200 commented answer / acting like // ?

Thanks. I didn't appreciate the distinction between <type 'int'=""> and <type 'sage.rings.integer.integer'=""> . I see that len() always returns something of type 'int' and since the elements of my list "b" above were all created by len() they were of type 'int'. And the sum of elements of type 'int' is also of type 'int'. And that's how I wound up dividing one integer by another.

Thanks also for the infinite sum.

2017-09-19 19:04:52 +0200 commented question / acting like // ?

Thanks. I now know how to do that.

2017-09-19 14:55:28 +0200 asked a question / acting like // ?

This script is meant to simulate rolling a fair die until a 6 occurs. I don't understand why at the very end my division of the sum of the rolls by the number of rolls is coming out the way it does. Thanks for your attention.

a=0;l=[];count=0;b=[] while count < 11: while a<6: a=choice([1..6]) l.append(a) print l count+=1 b.append(len(l)) a=0;l=[] s=sum(b);t=len(b) print "b= ",b,"Sum=",sum(b),"Throws=",len(b),"Sum/Throws=",s,"/",t,"=",s/t,N(s/t) print "Average over",len(b),"trials is",(sum(b)/len(b)) print "The type of sum(b) is",type(sum(b)),"The type of len(b) is",type(len(b))

2015-06-05 17:07:38 +0200 commented answer Numerical approximations

OK. "The first of the pair is the root, the second of the pair is its multiplicity."

2015-06-05 14:49:09 +0200 commented answer Numerical approximations

I see two ordered pairs, I think, but if that's so I don't understand why the y-values are 1 and not 0.

2015-06-05 14:41:22 +0200 answered a question Numerical approximations

With my background neither is particularly straight-forward but I am happy to learn about both methods. Thanks.

2015-06-04 01:33:02 +0200 asked a question Numerical approximations
g(x)=x^2-sqrt(2)
solve(g(x)==0,x)

[x == -2^(1/4), x == 2^(1/4)]

What's the best/quickest way to get numerical approximations of these values of x? Thanks.