Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27036
Joined: Oct 14, 2009
August 30th, 2014 at 3:18:32 PM permalink
I've been in a calculator making mood lately so just made one for the Powerball lottery, for lack of a better idea.

Please check it out. As always, I welcome all comments, questions, and especially corrections.

Some questions for you:

1. The Wikipedia page for the Powerball mentions a Power Play option, where you can double all the wins, except the jackpot, for an extra $1. However, the California Lottery makes no mention of this option. Is either page in error or do some states not offer it?

2. The California lottery page shows some of the smaller wins slightly above the values quoted in Wikipedia. If nobody hits the jackpot, does some money roll into the lower prizes? If not, why are they higher?

3. Does anyone know how to force displaying a very small number, like 10^-10, in decimal form using JavaScript? It normally defaults to scientific notation for very large and small numbers (close to zero) and I don't know how to override it.

4. Does anyone know how to make JavaScript put commas in a number over 1,000?

5. Does displaying the probabilities in "1 in x" format bother anybody? I never like to express probabilities that way, but that seems to be the norm when displaying lottery odds, plus the odds of hitting the jackpot are 0.00000000571 in decimal form, and I hate to waste a lot of space with all those zeros. I tend to think most Americans don't understand scientific notation, especially those who play the lottery, at the risk of being insensitive.

Thank you.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
beachbumbabs
beachbumbabs
  • Threads: 101
  • Posts: 14268
Joined: May 21, 2013
August 30th, 2014 at 3:27:38 PM permalink
The California lottery is a paramutual, so their prizes are different. It's a state law that everything wagered there has to be awarded somehow. We had a discussion about it a few months ago. And that's all I know about the specifics.
If the House lost every hand, they wouldn't deal the game.
Buzzard
Buzzard
  • Threads: 90
  • Posts: 6814
Joined: Oct 28, 2012
August 30th, 2014 at 4:08:53 PM permalink
Quote: beachbumbabs

The California lottery is a paramutual, so their prizes are different. It's a state law that everything wagered there has to be awarded somehow. We had a discussion about it a few months ago. And that's all I know about the specifics.



I actually have all the specifics. But can not post them here as a bitter ex-wide said I am never to be taken seriously.

You connect the dots, darling. A broken heart never heals.
Shed not for her the bitter tear Nor give the heart to vain regret Tis but the casket that lies here, The gem that filled it Sparkles yet
CrystalMath
CrystalMath
  • Threads: 8
  • Posts: 1911
Joined: May 10, 2011
August 30th, 2014 at 4:19:58 PM permalink
To display the long decimal number without scientific notation, use:

a = 0.00000000571;
string = a.toFixed(11);

You will need to know how many places you want first, though.
I heart Crystal Math.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6678
Joined: Jun 22, 2011
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27036
Joined: Oct 14, 2009
August 30th, 2014 at 5:11:33 PM permalink
I just added functionality for the Power Play. Note how for most jackpot sizes the return goes up for invoking the Power Play. The return on the Power Play alone is 84%, which for the lottery is very good.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
FleaStiff
FleaStiff
  • Threads: 265
  • Posts: 14484
Joined: Oct 19, 2009
August 30th, 2014 at 5:41:38 PM permalink
Quote: Wizard

I just added functionality for the Power Play. Note how for most jackpot sizes the return goes up for invoking the Power Play. The return on the Power Play alone is 84%, which for the lottery is very good.


Suggest you check if that Power Play "doubles" a non jackpot prize or multiplies it by the chosen value?
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27036
Joined: Oct 14, 2009
August 30th, 2014 at 5:43:23 PM permalink
Quote: FleaStiff

Suggest you check if that Power Play "doubles" a non jackpot prize or multiplies it by the chosen value?



As I state in the rules, it doesn't multiply the big jackpot and multiplies the 1M win by 2, no matter what the random multiplier is.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
EdCollins
EdCollins
  • Threads: 20
  • Posts: 1739
Joined: Oct 21, 2011
February 15th, 2015 at 11:46:33 AM permalink
Quote: Wizard

Please check it out. As always, I welcome all comments, questions, and especially corrections.


Is that a typo in Rule #2? The red Powerball can be from 1 to 35, not from 1 to 15.

Note the default values for the Calculator Section below the rules correctly show the Largest Power Ball at 35.
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6678
Joined: Jun 22, 2011
February 15th, 2015 at 12:35:53 PM permalink
Quote: EdCollins

Is that a typo in Rule #2? The red Powerball can be from 1 to 35, not from 1 to 15.


It could be a cut-and-paste from Mega Millions, which I think does have a 1-15 range for its "Megaball".
Wizard
Administrator
Wizard
  • Threads: 1518
  • Posts: 27036
Joined: Oct 14, 2009
February 15th, 2015 at 1:13:16 PM permalink
Quote: EdCollins

Is that a typo in Rule #2? The red Powerball can be from 1 to 35, not from 1 to 15.



Thanks for the correction.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
  • Jump to: