March 1st, 2023 at 4:08:54 PM
permalink

Hey, Wizard!

I'm a mathematician/engineer and I was working on a Lottery Calculator similar to yours and I think I've noticed a bug on your calculator(s). In the Power Ball and the Super Lotto Plus calculators, when you calculate the return, I believe you're dividing by the cost of the ticket twice, resulting in a much lower expected return.

The Power Ball calculator seems incorrect:

/games/lottery/powerball-calculator/

The Super Lotto Plus calculator seems incorrect:

/games/lottery/california-super-lotto-plus-calculator/

The Mega Millions calculator seems correct:

/games/lottery/mega-millions-calculator/

In the PowerBall calculator, if you just run it as is, you get the following stats for 0+Powerball:

Win: $4

Combos: 7,624,512

Ticket Cost: $2

Total Combos: 292,201,338

A quick calculation should get a return of

0.0521867

which is 4*7624512 / (2*292201338)

but you show 0.026093, which is half that.

In the code, it looks like you divide by cost in the for loop and then you divide by cost when you update the UI.

I'm a mathematician/engineer and I was working on a Lottery Calculator similar to yours and I think I've noticed a bug on your calculator(s). In the Power Ball and the Super Lotto Plus calculators, when you calculate the return, I believe you're dividing by the cost of the ticket twice, resulting in a much lower expected return.

The Power Ball calculator seems incorrect:

/games/lottery/powerball-calculator/

The Super Lotto Plus calculator seems incorrect:

/games/lottery/california-super-lotto-plus-calculator/

The Mega Millions calculator seems correct:

/games/lottery/mega-millions-calculator/

In the PowerBall calculator, if you just run it as is, you get the following stats for 0+Powerball:

Win: $4

Combos: 7,624,512

Ticket Cost: $2

Total Combos: 292,201,338

A quick calculation should get a return of

0.0521867

which is 4*7624512 / (2*292201338)

but you show 0.026093, which is half that.

In the code, it looks like you divide by cost in the for loop and then you divide by cost when you update the UI.

for (i=0; i<=5; i++)

{

yes_prob_array=yes_combin_array/total_combin;

no_prob_array=no_combin_array/total_combin;

yes_ret_array=(yes_prob_array*yes_win_array)/cost; // dividing by cost here

no_ret_array=(no_prob_array*no_win_array)/cost; // dividing by cost here

tot_ret+=(yes_ret_array+no_ret_array);

}

// code omitted here

s5ret.value=FormatNum(yes_ret_array[5]/cost,6); // dividing by cost again

s4ret.value=FormatNum(yes_ret_array[4]/cost,6); // dividing by cost again

s3ret.value=FormatNum(yes_ret_array[3]/cost,6); // dividing by cost again

s2ret.value=FormatNum(yes_ret_array[2]/cost,6); // dividing by cost again

s1ret.value=FormatNum(yes_ret_array[1]/cost,6); // dividing by cost again

s0ret.value=FormatNum(yes_ret_array[0]/cost,6); // dividing by cost again

5ret.value=FormatNum(no_ret_array[5]/cost,6); // dividing by cost again

4ret.value=FormatNum(no_ret_array[4]/cost,6); // dividing by cost again

3ret.value=FormatNum(no_ret_array[3]/cost,6); // dividing by cost again

2ret.value=FormatNum(no_ret_array[2]/cost,6); // dividing by cost again

1ret.value=FormatNum(no_ret_array[1]/cost,6); // dividing by cost again

0ret.value=FormatNum(no_ret_array[0]/cost,6); // dividing by cost again

Jack Hayes

March 1st, 2023 at 8:00:45 PM
permalink

Link fix:

https://wizardofodds.com/games/lottery/powerball-calculator/

https://wizardofodds.com/games/lottery/california-super-lotto-plus-calculator/

https://wizardofodds.com/games/lottery/mega-millions-calculator/

Enjoy the day.

https://wizardofodds.com/games/lottery/powerball-calculator/

https://wizardofodds.com/games/lottery/california-super-lotto-plus-calculator/

https://wizardofodds.com/games/lottery/mega-millions-calculator/

Enjoy the day.

May the cards fall in your favor.

- Jump to:
DEFUNCT CASINOS Bill's Gambling Hall & Saloon MonteLago O'Sheas Sahara Western FORUM INFO Announcements Help Rules GAMBLING Betting Systems Big Wins Blackjack Craps Dice Setting Gambling with an Edge Online Gambling Other Games Poker Slots Sports Betting Table Games Trip Reports Video Poker GAMBLING OUTSIDE VEGAS Asia Atlantic City California Eastern U.S. Europe/Africa Mississippi Nevada (other) Oceania The Americas Western U.S. GAMING BUSINESS Boyd Gaming Caesars Entertainment Game Inventors Corner MGM/Mirage Other Sands Station Casinos Wynn LAS VEGAS ATTRACTIONS Deals Food and Restaurants Night Clubs Other Attractions/Entertainment Relaxation and Rejuvenation Shopping Shows Strip Clubs Thrill Seeking LAS VEGAS CASINOS Aliante Casino Aria Arizona Charlie's Casinos Bally's Barcelona Bellagio Binion's Boyd Gaming Casinos Caesars Palace Cannery Casinos Casino Royale Casuarina Circus Circus Cosmopolitan D Las Vegas El Cortez Ellis Island Excalibur Flamingo Four Queens Golden Gate Golden Nugget Hard Rock Hilton Hooters Jean/Primm Casinos Longhorn Casino Luxor M Mandalay Bay MGM Grand Mirage Monte Carlo New York, New York Palms Paris Planet Hollywood Plaza Poker Palace Quad, The Rampart Rio Riviera Silver Nugget Silver Sevens Silverton Skyline Small Casinos South Point Station Casinos Stratosphere Treasure Island Tropicana Tuscany Vegas Club Venetian and Palazzo Wynn and Encore OFF-TOPIC Adult Discussions Free Speech Zone General Discussion GLBT Corner Gripes Kiosk Off-Topic Other Casinos Religion QUESTIONS AND ANSWERS Advice All Other Casual Corner Gambling Las Vegas (other than gambling) Math