Generating π from 1,000 random numbers

preview_player
Показать описание
Watch me calculate pi by rolling 1,000 random numbers on two d120 dice. All in the name of celebrating Pi Day 2017.

You can watch all 500 rolls of the dice!

Here are some proofs that the probability of two random integers being coprime is 6/π².

Download the spreadsheet I make at the end.

You can buy d120 dice from Maths Gear.

Here’s a nice summary of the Basel Problem from Plus Magazine.

While we’re talking about the Basel Problem: I cover it in my book. You know, just in case you were wondering.

Support me on Patreon and help me make more videos like this.

CORRECTIONS
- At 12:28 I say that 63 is 3 × 31 when it is of course 3 × 21. Spotted by Nathan James.
- Let me know if you spot any more!

Music by Howard Carter
Design by Simon Wright

MATT PARKER: Stand-up Mathematician
Рекомендации по теме
Комментарии
Автор

I'm actually more impressed by the ability to look at two random numbers and know if they are coprime within a few seconds.

thearth
Автор

Me: Can you calculate pi?
Matt: 3.04
Me: I think it's a bit higher.
<1 year later>
Matt: 3.05?

paytonrichards
Автор

a suggestion for next year:
1. at a constant rate, dig a tunnel through the center of the earth
2. at the same rate, walk along a path formed by a great circle around the earth
3. divide the walking time by the digging time

you can expect some error but it would make for great video

glowhazel
Автор

From that day forward it was forever known that Parker pi is equal to 3.052338478336799.

AtlasReburdened
Автор

There are 120^2=14400 possible pairs of numbers between 1 and 120.
8771out of them are coprime pairs.
This gives a value of

JavSusLar
Автор

When you're doing a time lapse like this in the future, can you please put an analog wall clock in the frame behind you so we can see it whirl around when you're working?

WarrenGarabrandt
Автор

As Pierre Roux suggested, I have used the digits of Pi as a source of random numbers from which to calculate pi! Taking the first 10^6 digits of pi, and splitting them into 10^5 integers of length 10, I got 5*10^4 pairs of random integers (assuming the digits of pi are truly random - this is unproven). Comparison of these integers yields the estimate 3.14099105107796, which is accurate to a 0.00019% error :)

PI-Ception!

adambrown
Автор

"I probably made some mistakes... I'm kinda hopping the mistakes have averaged out."

It's good coming back to older videos and seeing that the spirit of Matt hasn't changed one bit in essence.

jan_kulawa
Автор

I'm probably not the first person to mention this, but in Excel you can have it just count a column in its entirety. You don't need to define a set range, you can just put COUNT(C:C) and then you can add more rows at will without having to edit that function.

tone
Автор

the montage starts at 3:14, coincidence? i think not

xgozulx
Автор

For those following along at home, these are the methods of calculation he has used in order of decreasing error: calculating the first terms of an infinite series (off by 3.1%), rolling two dice 500 times (off by 2.8%), timing a pendulum of known length (off by 0.433%), weighing a cardboard circle (off by 0.31%), and measuring a circle using pies (off by 0.1035%).

gabrielnorris
Автор

Another simpler way:

- Take random pairs of numbers in [0, n] and interpret them as x and y coordinates within an n*n square
- For each pair, calculate the distance to the origin.
- Count the number of pairs for which that distance is less than or equal to n

Effectively, you've just determined whether or not that point is inside of a quarter-circle centered at the origin, with a radius n. So, the probability that a pair will be in that group is:

p = ((area of circle) / 4) / (area of square)
= ((πn^2) / 4) / n^2
= π / 4

ClarkCox
Автор

so if you wanted to do this perfectly, you would need 2 infinitely sided die, which are spheres... PI strikes again

jeffreyjoseph
Автор

12:20 "63 has a 3 in it, it is 31*3" XD, You need a nap Matt

TheBlazeThrower
Автор

I know all PI digits, not in the correct order though

wicchi
Автор

how long until the Parker square jokes when he doesn't perfectly calculate pi

Pwjrjuxmawhrnx
Автор

If your happened to get really lucky and select exactly 304 dice, it would give an approximation for pi about:
3.1414043... which is astronomically close :).

vishaalram
Автор

Actually, the random function gives you a number in the interval [0;1). So the random number is between zero and one and can take on the value 0, but not the value 1. When you multiply by 120, you get a number in [0;120). *The correct way to proceed* at this point is to *round down and add one*. This gives a number in the range [0;119] plus 1, which is in the interval [1;120]. If on the other hand, you round up, you mess with the probabilities, because in case the random number is 0, you get roundup(0·120)=roundup(0)=0, which is outside of your desired range. Also, drawing 120 is slightly less likely because the event of the "direct hit" (where no rounding is required) is missing (which is kind of a sloppy explanation, but I hope y'all get what I mean).

DMSG
Автор

3:47 Yes, 169 is a great darts score. It's also impossible to score 169 in just one visit.

ThorHC
Автор

Right now i'm gonna write a code so that the range of random number generated is much larger, thanks matt this will be a good test since i'm only a begginer in coding

shambobasu