On Mon, Mar 15, 2010 at 1:41 PM, Kevin <[email protected]> wrote:
> ...me make a graph for this code.
> The code makes a distribution of 2 dice.
>
> It would be nice to have a graph to go with it.
>
>
>
> from random import random
> maximum = 10000
> counts = [0,0,0,0,0,0,0,0,0,0,0,0,0,0]
> n = 0
> while n < maximum:
>    dieOne = int(random()*6)+1
>    dieTwo = int(random()*6)+1
>    dieSum = dieOne + dieTwo
>    counts [dieSum] = counts [dieSum] + 1
>    n = n + 1
> counts [1:]
>

Do the following after the above:

T = finance.TimeSeries(counts)
show(T.plot_histogram(bins=len(counts)), frame=True)


 -- William

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to