Two Phone Numbers With The Same Digits?

The 538 Riddler question this week isn’t especially interesting. What are the chances that somebody’s phone number has the exact same seven digits as your phone number, just in a different order? But as I was driving home thinking about it, I realized that there were several different ways to go about this and I wondered which was faster.

Continue reading “Two Phone Numbers With The Same Digits?”

Advertisements

Average Distance Between Points On or In a Circle

I recently came across an interesting math problem on youtube (why youtube keeps showing me these when I’m watching cooking shows, I’ll never understand, but I digress).  What is the average distance between two random points on a circle?  This can also be expanded to ask what is the average distance between two random points inside a circle?  Now of course I’m not going to sit down and do lots of math to figure this out, but it is a kinda interesting problem for a monte carlo simulation.  So I dusted the python off and went to work.

Continue reading “Average Distance Between Points On or In a Circle”

Birthday Paradox Monte Carlo Simulation

Many of you are familiar with the Birthday Paradox.  If you want to read more about it you can find a good article here.  Basically, it says that in a room of 23 people, there is a 50% chance that at least two people share a birthday.  And if you increase that number to 75 people, the chances go up to 99.9%.  I wanted to explore this a little more and rather than doing the math (boring!), I decided to do a Monte Carlo simulation, run it a bunch of times, and plot the results.

Continue reading “Birthday Paradox Monte Carlo Simulation”

Riddler Classic – 11-4-2016 – Will You Decide the Election?

Here’s my solution to this week’s Riddler Classic puzzle FiveThirtyEight.  Here’s the question: ” You are the only sane voter in a state with two candidates running for Senate. There are N other people in the state, and each of them votes completely randomly! Those voters all act independently and have a 50-50 chance of voting for either candidate. What are the odds that your vote changes the outcome of the election toward your preferred candidate?  More importantly, how do these odds scale with the number of people in the state? For example, if twice as many people lived in the state, how much would your chances of swinging the election change?”

Continue reading “Riddler Classic – 11-4-2016 – Will You Decide the Election?”

Riddler Classic – 10-14-2016 – Arbitraria

Here’s my solution to this weeks Riddler Classic puzzle from FiveThirtyEight.  Here’s the question: “While traveling in the Kingdom of Arbitraria, you are accused of a heinous crime. Arbitraria decides who’s guilty or innocent not through a court system, but a board game. It’s played on a simple board: a track with sequential spaces numbered from 0 to 1,000. The zero space is marked “start,” and your token is placed on it. You are handed a fair six-sided die and three coins. You are allowed to place the coins on three different (nonzero) spaces. Once placed, the coins may not be moved. Continue reading “Riddler Classic – 10-14-2016 – Arbitraria”

Riddler Express – 10-14-16 – Turning Coins Over

Here’s my solution to this week’s Riddler Express question from FiveThirtyEight.  Here’s the question: “You place 100 coins heads up in a row and number them by position, with the coin all the way on the left No. 1 and the one on the rightmost edge No. 100. Next, for every number N, from 1 to 100, you flip over every coin whose position is a multiple of N. For example, first you’ll flip over all the coins, because every number is a multiple of 1. Then you’ll flip over all the even-numbered coins, because they’re multiples of 2. Then you’ll flip coins No. 3, 6, 9, 12 … And so on. What do the coins look like when you’re done? Specifically, which coins are heads down?”

Continue reading “Riddler Express – 10-14-16 – Turning Coins Over”

IHG Priceless Surprises Monte Carlo Simulation

Over at One Mile At A Time, they did an analysis of the recent IHG Priceless Surprises Promotion where you could mail in 94 entrees and get back 94 plays in an online game.  Most entrees only won 500 points but some won 1000, 2000, 5000, and a few won free nights or gift cards.  I liked his analysis and it got me thinking about possible wins and the distribution.  Instead of doing a bunch of math, it was easier to create a Monte Carlo Simulation and the results were a little surprising.

Continue reading “IHG Priceless Surprises Monte Carlo Simulation”