powerball simulation

Powerball simulation

GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

GitHub is where the world builds software

Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.

Use Git or checkout with SVN using the web URL.

Work fast with our official CLI. Learn more.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio

Latest commit

Git stats


Failed to load latest commit information.

Simulation of the Powerball lottery in Java

This is a tiny little project I made in my spare time to better observe how hilariously unlikely you are to make money playing the lottery. It’s by no means a work of art, but is hopefully very clear.

Powerball is a trademark belonging to someone I don’t know with lawyers I don’t want to meet.

  1. Edit the few variables there are (# tries, jackpot value, winning numbers)
  2. Execute the java program using whatever your favorite Java environment is.


Simulation of the Powerball lottery in Java

Simulation of the Powerball lottery in Java. Contribute to gkubed/powerball-simulation development by creating an account on GitHub.

Simulate playing the US Powerball

US Powerball details & rules

The US Powerball holds the record for the largest Jackpot in the world, sitting at an incredible $1586.4M.

The main balls and the Powerball are drawn from 2 separate barrels. The main barrel contains numbers from 1 to 69, and the Powerball barrel numbers from 1 to 26. 5 numbers are drawn from the main barrel, and one Powerball is drawn from the Powerball barrel.

For an extra $1 (so $3 per ticket instead of $2), players can opt into the PowerPlay option. The PowerPlay option allows players to multiply their dividends, up to a maximum of $2M.

After the main numbers and the Powerball are drawn, the PowerPlay number is drawn from yet another barrel. This barrel contains 42 balls ranging from 2 to 5, with the smaller balls represented more frequently. Here is the breakdown:

PowerPlay barrel breakdown – without 10x

PowerPlay (Multiplier) 2 3 4 5
Balls in barrel 24 13 3 2
Odds of being drawn 57.14% 30.95% 7.14% 4.76%

If the Jackpot is below $150M, an extra 10x PowerPlay ball is added to the barrel. When this happens, the odds look like this:

PowerPlay barrel breakdown – with 10x

PowerPlay (Multiplier) 2 3 4 5 10
Balls in barrel 24 13 3 2 1
Odds of being drawn 55.81% 30.23% 6.98% 4.65% 2.33%
US Powerball Division and Dividends

Match Odds (1 in..) Dividends Average Winners *
5 Numbers + Powerball 292,201,338 Jackpot! currently $216,000,000 0
5 Numbers 11,688,054 $1,000,000 1.10
4 Numbers + Powerball 913,129 $50,000 8.90
4 Numbers 36,525 $100 343.40
3 Numbers + Powerball 14,494 $100 790.30
3 Numbers 580 $7 20,067.90
2 Numbers + Powerball 701 $7 16,677.10
1 Number + Powerball 92 $4 128,561.40
Powerball 38 $4 308,138

* Note: The average winners is caculated over the last 10 draws

Latest draws and results for the US Powerball

We keep track of the latest draws. Find out what the latest results are. Latest draws and results – US Powerball

Simulate playing the US Powerball with paper money. Can you guess the 5 main numbers and the Powerball? Find out for free.