HP Forums
Powerball generator - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Powerball generator (/thread-22335.html)



Powerball generator - Joe Horn - 09-14-2024 01:26 PM

A recent thread in the "Not quite" forum discusses generating Powerball numbers on various programmable calculators. The task is almost too easy on the HP Prime in CAS view:

{SORT(rand(5,1,69)),RANDINT(26)}

That's all it takes to generate a Powerball ticket. The undocumented rand(x,y,z) function automatically performs selection without replacement. Example: Sequential outputs after RANDSEED(pi):

{[ 16 18 31 64 67 ], 14 }
{[ 4 26 28 42 68 ], 23 }
{[ 31 40 44 53 67 ], 3 }
and so on.

Disclaimer: Using this method for ticket generation does not improve your chance of winning the lottery. However, buying one ticket instead of no ticket improves your chance of winning by infinity percent.


RE: Powerball generator - lrdheat - 09-14-2024 02:47 PM

Already had put that in a user key! I rarely use ii (Powerball). I do use the Texas Lottery version in a user key once a week or so…(although I usually use my HP 42S program for that as the HP 42S is much more shirt pocketable!)