For fun, I have created a sweet and short small animation procedure, which I must say is one of my biggest programs yet (gasp!) as much as I have played with Maple I should have at least created a few more ... In any case, it is a procedure of a random set of numbers chosen and displayed in a histogram on the left with a running total tallied on the right. It is by no means efficient (but feel free to fix up my code and tweak it a little bit, and let me know so I can learn more) It does contain a lot of lists in loops (I know I know bad thing to do) however that's my starting point and the one I'm currently most comfortable with. So check it out. Yes it probably can be made much mcuh more efficiently.

#initial and final - random numbers to fall between these values
#number - number of random numbers per set
#sets - number of sets

randhistogram := proc (initial, final, number, sets)
local i, a, b, c, d, aa, bb:
for i from 1 to sets do
  a[i] := [seq((rand(initial .. final))(), i = 1 .. number)]:
  b[i] := Statistics[Histogram](a[i], frequencyscale = absolute, binwidth = 1, range = initial .. final+1):
  c[i] := [seq(op(a[i]), i = 1 .. sets)]:
  d[i] := Statistics[Histogram](c[i], frequencyscale = absolute, binwidth = 1, range = initial .. final+1)
end do:
aa := plots[display](seq(b[i], i = 1 .. sets), insequence = true):
bb := plots[display](seq(d[i], i = 1 .. sets), insequence = true):
plots[display](Array([aa, bb]))
end proc:

randhistogram(1,20,20,100)

There was no menu bar here to enter pictures, or links for a downloaded file so you'll just have to copy it over. Also there's probably other ways of generating better random numbers.


Please Wait...