Thursday, October 22, 2020

Prime Number Spirals


 

I invite readers to review prior posts on prime numbers and Pi:

Ulam Spiral

Twin Prime Sandwich and a Prime Number Property Rediscovered

Estimation of Pi

I recently viewed a very graphic video by Grant Sanderson who ties the above ideas together with a prime number spiral (of course, I first thought it would be another take on the Ulam spiral but I was pleasantly surprised that there was another prime number spiral) that appears in polar coordinates. I can't simplify the video by Grant Sanderson (3Blue1Brown) any further but here is a link for your viewing: 

Why do prime numbers make these spirals?

My favorite part of the video is when Grant Sanderson reminds us math fans that the more we learn about various aspects of mathematics, the more we see the various connections (for instance the links between polar coordinates, pi and prime numbers).


Sunday, October 11, 2020

My Favorite Math Websites

This list will grow in time as I'm sure I'll get additional suggestions.

Numberphile has audio and video podcasts. Producer Brady Haran does a very good job in the audio podcasts as he and his guests have to be able to explain mathematical concepts without any visual help. There are many topics also done on YouTube which allow visual aides.

https://www.numberphile.com/podcast/


Desmos is an on-line graphing calculator that allows one to explore relationships.

https://www.desmos.com/


3blue1brown, or 3b1b for those who prefer less of a tongue-twister, centers around presenting math with a visuals-first approach. Rather than first deciding on a lesson then putting illustrations to it for the sake of having a video, almost all projects start with a particular visualization, with the narrative and storyline then revolving around this image. 3b1b is hosted by Grant Sanderson.

https://www.3blue1brown.com/

Favorite place to explore integer sequences: On-Line Encyclopedia of Integer Sequences (OEIS): https://oeis.org/

Favorite Math comedian: Matt Parker (a frequent contributor to Numberphile)

Matt Parker | Standup Mathematician (standupmaths.com)


Favorite Math author: Alex Bellos
Alex Bellos

Best explanation of math without numbers:
https://milobeckman.com/home-2021.html
Also see post: https://jamesmacmath.blogspot.com/2021/03/math-without-numbers-book-review.htmlMath Without Numbers

Best middle-school to high-school resource - Eddie Woo's: Wootube – Find joy in learning mathematics. (misterwootube.com)

Eddie Woo also authored:
It's a Numberful World: How Math is Hiding Everywhere (Books + TV – Wootube (misterwootube.com)

I've also become a fan of Jordan Ellenberg, author of 

Shape, The Hidden Geometry of Information, Biology, Strategy, Democracy, and Everything Else 

and

How Not To Be Wrong, The Power Of Mathematical Thinking

Favorite Independent Science: A New Kind of Science

A New Kind of Science - Wikipedia


A great deal - free e-book. This is a magnificent way to share knowledge and encourage exploration of a completely different way of approaching math and science.
Stephen Wolfram: A New Kind of Science | Online—Table of Contents (wolframscience.com)

Update 7-28-2021 An article about Wolfram's and other scientists' effort to explain why the universe exists: Why does the Universe exist at all? - BBC Science Focus Magazine

Saturday, October 10, 2020

Brussels Choice



This post is inspired by my friends who are driven by the Collatz Conjecture (see prior posts: HOTPO, additional thoughts). The  Numberphile Podcast has a short video introducing the Brussels Choice, a problem of sequences. The guest on this episode is the founder of the OEIS (the On-Line Encyclopedia of Integer Sequences), Neil Sloane.

Like the Collatz Conjecture, one starts with any integer and follows simple rules to convert the number to 1 (or other numbers) in a series of steps. Unlike the Collatz Conjecture, not all numbers can be converted to 1. Numbers ending in 5 and 0 cannot be converted to 1 but can be converted to 5.

Rules:

  • Any digit or sequence of digits within the number that ends with an even number can be doubled or halved. The other digits are unchanged.
  • Any digit or sequence of digits within the number that ends even an odd number can only be doubled. The other digits are unchanged.

Example - start with 6113

Double the 3, the remaining digits are unchanged: 6116

Divide 16 by 2: 618

Divide 8 by 2: 614

Divide 4 by 2: 612

Divide 2 by 2: 611

Divide 6 by 2: 311

Double the final 1: 312

Divide 312 by 2: 156

Double 1: 256 (a power of 2)

Divide 256 by 2 and repeat 7 more times to reach 1.

Example - start with 90 (numbers ending with a 0 or 5 can be converted to 5)

Double 9: 180

Divide 8 by 2: 140

Double 14: 280

Double 28: 560

Double 56: 1120

Divide 12 by 2: 160

Divide 16 by 2: 80

Divide 8 by 2: 40

Divide 4 by 2: 20

Divide 2 by 2: 10

Divide 10 by 2: 5


The site Code Golf, has a challenge to write the code to determine if two numbers are connected by the Brussels Choice.

Friday, October 9, 2020

What is the next number in the sequence...?

In 1964 Neil Sloane started the maintenance of a list of integer sequences. Once his collection grew, he published the list in a book in 1973 ("A Handbook of Integer Sequences", by NJAS, Academic Press, NY). This book contained 2372 sequences.

Since 1996. the list in the form of a database has been maintained on the internet. As of the date of this post, it has over 300,000 different sequences that can be searched in many different ways. The formal name is The On-Line Encyclopedia of Integer Sequences or OEIS. This is a link to the database.



The database is copyrighted by the OEIS Foundation, Inc. 

Just to try out, I entered "1,2,3,4,5" in the search function. As expected, the first sequence listed was the positive integers (OEIS sequence identified as A000027). What I didn't expect was that there were 6820 other sequences that begin "1,2,3,4,5."

Many famous sequences are included such as the list of prime numbers, A00040, the Fibonacci numbers, A000045, and Pascal's triangle, A007318.

3-16-2021 Update.

I suggest viewing Mathologer YouTube entry on "What Comes Next?"

Also, view these Numberphile videos showing some of these sequences graphed:

Amazing Graphs

Amazing Graphs II

Amazing Graphs III


3-26-2023 Update: My proposed sequence was published in the OEIS - 
A361746 - OEIS.

To view any of the sequences that I've authored or to which I have contributed, see: james c. mcmahon - OEIS.

Monday, October 5, 2020

Tribute to Ronald Graham's Largest Number ...262464195387

What is the largest number? Any number that is offered can be bettered by that number plus 1. A common answer is infinity, although infinity isn't a specific number. "Infinite" describes something that is without bounds. Something could be infinitely large (set of integers) or something could be into infinitesimally small (as done in calculus). 

Another approach to this question of the largest number is to ask what is the largest number used in a proof. In 1977 the mathematician Ronald Graham established the world record for the largest specific integer used in a mathematical proof. Graham's number is so large that if all the atoms in the universe were made into ink, the number could not be written. That is certainly disappointed for the readers of this post who wanted to see the number.

However, the last digits of Graham's number are: ...262464195387.

The actual expression of Graham's number uses hyperoperators which are higher order forms of exponentiation. 

Since 1977, Graham's number has been exceeded by larger super-numbers used in proofs. One example is TREE(3).

Ronald Graham passed away in 2020 and was honored in a Numberphile podcast. An earlier podcast specifically described Graham's number. While the end digits of Graham's number have been determined, the first digit is unknown. Graham was asked what digit he would like it to be and he said he actually knew the first digit but only when the number is expressed in base-2 and then it is 1.

The icon I chose for this post is juggling because Ron Graham was an accomplished juggler. For a photo of Graham, see New York Times Obituary Link with photo.



Sunday, October 4, 2020

A Simple Pythagorean Theorem Proof

 

I recently came across a proof for the Pythagorean Theorem that is simple and contains a minimum amount of equations. It may be one of the most direct and understandable proofs of the many that exist. A nice animation of this proof is found at MathAdam.

 

Start with your standard right-angle triangle of sides A, B and C with C being the hypotenuse.

 


Draw a line perpendicular to C to the opposite vertex.





Now, in addition to the original triangle, there are two additional right-angle triangles formed. One has the side A as its hypotenuse (well name triangle A) and the other has side B has its hypotenuse (triangle B). The original triangle with sides ABC will now be called triangle C. The three triangles, A, B, and C are all similar A ~ B ~ C. (This can be established by the fact all three has the same interior angles.) Another key fact that we can see is the area of A + B =  area of C

The next step is to flip over each of the three triangles.


The next step is to the draw out squares on each of the three sides.

The relative sizes of the squares have the same relative ratios as the triangles A:B:C.

Since the areas of triangles has the relationship: A + B = C, then the same applies for the squares, therefore A2 + B2 = C2.




                

Sunday, September 6, 2020

One-Time Pad Coding and a Proposal for Improvement

(Image: Iconfinder - Font Awesome on Iconfinder)


A one-time pad (OTP) is a coding system that cannot be cracked. The system uses a set of random characters (the OTP) to encode a message by a sender. The receiver, who also has the OTP, decodes the message. The rules for keeping the OTP secure are:

1. Only the sender and receiver have the OTP. That is, the key is truly secret.
2. The OTP is only used once.
3. The OTP must be at least the same length as the message. If it isn't, then part of the OTP would be used over and that would violate Rule 2 above.
4. The OTP must be truly random.

The term one-time pad is used because the original system used two identical pads of sheets containing random characters. The users would each use one sheet from their pads for a message then destroy the sheets used. 

It has been proven that the OTP provides perfect secrecy. This seems like a bold statement given the ever-increasing power of computers. One would think the code could be cracked by use of the brute force method - using a super-computer to try every possible key to decrypt the encoded message. While a super-computer could try every possible key, in doing so it would also produce every possible message of the given length of the OTP.

Here's an example, I used the Boxentriq Code-Breaking site to encode the ten-character message "KISS POTUS" using the OTP key of "JIHGFEDCBA" to produce the result "TQSRTRVVS". My key doesn't follow Rule 4 but it I'm using it just for demonstration purposes. The supercomputer would eventually get to the key "JIHGFEDCBA" and produce the result "KISS POTUS"; however, it would also produce every other possible ten-character combination, including "KICK POTUS", "I LIKE YOU", "GO HOME NOW" and millions of other possible messages and many more millions of just random, scrambled letters. While the supercomputer "cracked" the code, one would not know which of the millions of results was the intended message.

There are weaknesses of the OTP system. Keeping the key secret is a human weakness. Producing truly random characters is system weakness. 

A Proposal for Improvement
Instead of the sender and receiver having long, identical pads, they agree on the digits of a single irrational number to be used as the key for the OTP. Irrational numbers, such as the square root of 2, can be expressed succinctly (and have the advantage that their digital expansion continues infinitely without any recognizable pattern - square root of 2 = 1.414213562373095048801688724210...).

The users of the code would agree on what irrational number to be the key for their initial message. The sender would reserve the last few characters of the message to indicate the key for the next message - another irrational number. There is an unlimited supply of such numbers. One could also have a program to randomly produce each subsequent key to use. 

I'm new to this subject, so it is very possible someone has already suggested this method. 

A site with resources for many code systems: Boxentriq Code-Breaking 

Wikipedia entry: One-time pad

An example of a ten million digit pad based on the digits of pi. Digits of pi are discussed in these other posts.


8/6/2021 update: also review Vigenere cipher

6/21/2024 updated: I've made a Mathematica routine to encode and decode messages using the strategy noted in this blog post. Leave a comment with your email and I'll share with you.



Wednesday, July 15, 2020

Incompleteness

Kurt Gödel portrait
For thousands of years, mathematicians searched for a set of axioms from which all mathematical truths could be derived. Their dreams were shattered when Kurt Gödel published his incompleteness theorem. He proved that there can be no set of axioms from which all other mathematical facts can be derived. The result is there will always be truths that cannot be proven. We are then left with questions that may or may not have answers such as the Collatz Conjecture, Goldbach Conjecture and many other unproven mathematical conjectures. We may be disappointed that we'll never have a single set of axioms for mathematics, but Gödel's proof leaves us with the extra challenge of proving these conjectures knowing such proof may or may not exist.

Also see recent article: 

Natalie Wolchover

https://bigthink.com/surprising-science/kurt-godel-foundations-mathematics-unproven

Thursday, June 18, 2020

Remember when Gas was Just $0.30/gal?

(By T4c. Messerlin. (Army) - http://www.dodmedia.osd.mil/Assets/1999/DoD/HD-SN-99-02404.JPEG, Public Domain, https://commons.wikimedia.org/w/index.php?curid=52903)

A friend recently sent me a greeting card with an insert showing what happened the year I was born (1959). Along with who was President (Dwight Eisenhower), Best Picture (Ben-hur) and top song (Lonely Boy by Paul Anka), the insert include the price of common items.

These prices provide a good check for what type of inflation we have had for the last 61 years. Lately, we have enjoyed several years of relatively low inflation (<= 3% since 2008). Going back to the period of 1973 to 1981, the rate was much higher, sometimes reaching over 10%.

A future price of an item, P2, based on an original price, P1, after undergoing n periods of inflation at rate, i (expressed in decimal form):


This formula can be used to calculate the inflation rate for each of the items listed.
 

Item

1959 Price

2020 Price

Inflation

Min. Wage

$1.00/hr

$13.00/hr

4.3 %

Gas

$0.30/gal

$2.89

3.6 %

House

$18,400

$578,000

5.8 %

Milk

$1.01/gal

$ 4.00

2.3 %

Eggs

$0.88/doz

$ 3.00

2.0 %

US Postage Stamp

$.04

$.0.50

4.2 %

Dow Jones Indus Ave.

679

26080

6.2 %


The last item listed is the Dow Jones Industrial Average stock index. Its average growth over the past 61 years was 6.2%. That's higher than any of the items listed including the house (the 2020 price was California median price for 2020).  The prices you currently pay are likely different based on your favored brands and location. So if you would like to check the rate for your items, please see the link where these calculations will be done for you. You just need to enter the two years of interest and the old and new prices. The spreadsheet will do the rest. 

Tuesday, June 16, 2020

Say Hello to Your Cousin

During the sheltering-in-place phase of the Covid-19 crisis, I've been reaching out to relatives across the country. We all have the same concerns of protecting family members who may be at risk or helping others who are struggling during the crisis. In the conversations, I discovered that I have a number of cousins working on family genealogy projects. It is interesting as one learns about their extended family trees. 

If two people at random meet, what are the chances the two are cousins? Very rare if you limit the term cousin to mean the two subjects have a common grandparent or great-grandparent. If we only go back two generations, our two subjects each have four grandparents and they are not related (as first cousins) if they have no common grandparent. We can continue this exercise, comparing great-grandparents, great-great-grandparents and so on. With each generation we go back, there is a doubling of potential ancestors of whom our two subjects may have in common. Eventually, every random pair of people will have one or more common ancestors thus making them cousins (although very distant). 

How many generations do we have to go back to guarantee this matching will occur? Making an assumption of one generation for every 25 years, and going back about 28 generations, brings us to the 14th century. Two raised to the power of 28 is 268 million. If our two subjects each have 268 million super-great-grandparents, that would require there be no overlap in any of the 526 million ancestors for the two subjects not to be related. The reason I took this exercise back 700 years, is the world's population at that time was only 300-400 million people which means the two people must be distant cousins.

Some have taken this topic much further using mitochondrial DNA analysis to estimate that determine all humans have a single common female ancestor, termed Mitochondrial Eve

Update (1/19/2021) - Numberphile has a video that explores the math of ancestors with similar results: Numberphile Ancestors.

Update (10/8/2022) - If you have blue eyes and meet someone else with blue eyes, you can also greet that person as your cousin. See this article reporting that everyone with blue eyes is a descendant of a single human from about 6000 - 10000 years ago.

One Hundred Trillion


My last post wrote about the approximate one trillion platelets in my blood donation. Another post described the power of compound interest in which a very modest investment could grow substantially over four hundred years at just a modest interest rate.

There is another example of when interest rates are very high. The enormous multiplying effect doesn't take hundreds of years - only months. That it what led the country of Zimbabwe to issue a one hundred trillion dollar note. At the peak of this period of hyper-inflation around 2007-2009, the cash in your pocket could be worth half, or less, than what it was the day before. In a single year, prior to the issuance of the note shown above, the country issued notes ranging from 10 dollars to 100 billion dollars.

When Zimbabwe gain independence in 1980, their dollar was about worth one United States dollar (USD). When my friend gave me the 100 trillion dollar note shown, it was worth about one USD.

Wednesday, June 10, 2020

One Trillion!


I'm a regular blood donor and in the photo I'm shown with the local blood bank staff as I surpassed the 10-gallon milestone (we're all in masks since this donation was made during the Covid crisis of 2020). This particular session, I donated both blood and platelets. As I finished, I reviewed the monitor on the apheresis machine that summarized my donation: 980,000,000,000 platelets collected (just 2% shy of one trillion).

1/15/2022 Update - I recently reached my 15-gallon milestone. I checked my last platelet donation, and the count was 1.1 trillion.

Saturday, June 6, 2020

Project Euler


In response to reading my blog, a friend suggested that I join Project Euler. The site has over 700 problems to challenge its members by solving mathematical problems using programming. The group just crossed over one million members this year. 

As a fan of Grant Sanderson's 3Blue1Brown site and his many videos, I took his suggestion of improving my mathematical skill by learning new programming. It's been over 25 years since I did any serious programming, so my skills are rusty and outdated. I've been learning Python and slowly I've been able to solve some of the Euler Project challenges.



Here's an example of a problem from Project Euler

A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,

a2 + b2 = c2

For example, 32 + 42 = 9 + 16 = 25 = 52.

There exists exactly one Pythagorean triplet for which a + b + c = 1000.
Find the product abc.


I gravitated toward this problem because one of my first posts on this blog dealt with Pythagorean Triples. I used the tip posted to get a head start in finding the desired triplet of (200, 375, 425). Achieving the correct answer was good reinforcement of Grant Sanderson's advice to learn new programming skills.

Monday, June 1, 2020

How Rare is That Dollar?


The one-dollar bill shown in the photo is somewhat rare. Not so rare that it is worth more than one US dollar, but rare from the perspective of its serial number. That fact may seem surprising. At first glance, the serial number 29573801 doesn't appear extraordinary in any way; it looks just like one of the random 100,000,000 possible serial numbers possible in the 8-digit sequence. You'll see why it is rare after reading the following challenge.

In a prior post, I described a friendly bar bet in which you could easily estimate the number of prime numbers found in a range between two given numbers. A good friend was disappointed with the bar bet because most of his drinking friends don't know what a prime number is. So, I'm offering him a new challenge to try.

Ask your friend to take the first dollar bill out of his wallet or billfold. Without either of you looking at the serial number, he should place it on bar with his hand covering it. Now offer him $10 if the serial number has no repeated digits; if it doesn't, you win the bill. The bill in the photo would be a winner for your friend. Its serial number of 29573801 has no repeated digits. 

The wager is heavily weighted in favor of you. Only about 1 in 55 bills will have a serial number with no repeated digits. 

To see why this occurs so infrequently, consider the specific bill pictured in the photo. Of the digits 0 through 9, it is missing 4 and 6. Let's first calculate the probability that a given bill is missing the digits 4 and 6 and doesn't repeat any of the numbers. Moving through the serial number one place at a time, to meet this criteria, the first digit can be any number except 4 or 6. That leaves 8 digits out of 10. So the probability of getting through the first digit is 8/10. Now, moving to the second digit of the serial number, we need the probability that it is not a 4, 6 or a repeat of the first digit. That leaves 7 digits, so our probability of making it through the first two digits is 8/10 x 7/10. Continuing with all the remaining serial number's digits we find a probability of 8/10 x 7/10 x 6/104 x 5/10 x 4/10 x 3/10 x 2/10 x 1/10 which equals 40320/100,000,000 = .0004032. Next we have to adjust this probability because it was for the very specific case of a bill having no repeated digits and no 4 or 6. There are a total of 45 combinations of the two excluded digits, so our final probability is .000432 x 45 = 0.18144 or roughly 1 in 55.

Saturday, May 30, 2020

Counting Prime Numbers


(Design vector created by freepik - www.freepik.com)
Imagine challenging a fellow mathematics fan to a friendly bar bet in which the person who best estimates the number of prime numbers found between a range of two given numbers wins a drink. Let your friend pick the first number and you will pick the second number. A list of prime numbers up to 10,000,000 is available here for you to check your answers. 

What do you have to know?
You won't have to remember lengthy lists of prime numbers to win your bet. You just have to remember two numbers: 165 and 72.

After your friend suggests the first number, add 165 to get the second number of the range. To get your estimate, round the top number of the range to the nearest power of ten. Divide 72 by the number of zeros in the rounded number and this will be your estimate. So if your friend suggests 1000 for the first number, you'll state the second number will be 1165. Rounding 1165 to the nearest power of ten is 1000. Dividing 72 by 3 - the number of zeros in 1000 - yields an estimate of 72/3 = 24.

Going to the above link, if we count the number of primes between 1000 and 1165, we find the following primes: 
1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069,1087,1091,1093, 1097,1103,1109,1117,1123,1129,1151,1153,1163. The count of actual primes is 24, matching your estimate.

Here's another example. Your friend picks 1 as the starting number; you add 165 so the final number is 166. Rounding 166 to the nearest power of 10 is 100. Divide 72 by 2 (the number of zeros in 100) and your estimate is 36.

Referring to the link above the the primes between 1 and 166 are: 
2, 3, 5, 7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101, 103,107,109,113,127,131,137,139,149,151,157,163. The actual count is 38. Your estimate is still very close and probably closer than what your friend could estimate or count in a quick period of time.

How does this quick estimation work?

The key to this trick is the prime number theorem which states the number of primes less than a given number, n, is approximately: n/ln(n). Alternately, we can say the relative frequency of primes near n is 1/ln(n). Note: the prime-counting function is also discussed in another post: Math Vacation: The Frequency of Prime Numbers – The Prime Number Theorem (jamesmacmath.blogspot.com).

Our estimate used the nearest power of 10 as a starting point. Counting zeros in a number that is a power of ten is the same as taking the log(base 10) of that number. Log(100) = 2, Log(1000) = 3, Log(10000) = 4 etc. The prime number theorem uses ln(n). Converting from log(n) to ln(n) is a factor of 2.3.

The prime number theorem stated the relative frequency of primes near n is 1/ln(n), so our estimate for a range of 165 should be 165/ln(n). Converting from log(n) to ln(n), our estimate becomes 165/(2.3 log(n)) or approximately 72/log(n). The range of 165 was chosen so we would end up with 72 in the numerator. Since 72 is easily divisible by many numbers, your estimation task is a little easier. 

A prior post wrote about the "Rule of 72" for quick approximations of compound interest. Now you have 2 uses of the number 72 to make quick estimations.

Credit is given to Grant Sanderson's site, 3b1b, for inspiring this trick. More on the natural logarithm is given here by Grant: 

https://www.3blue1brown.com/videos-blog/what-makes-the-natural-log-natural-lockdown-math-ep-7.

Thursday, May 28, 2020

Trigonometric Proof of Pythagorean Theorem


This proof is similar to Bhaskara's second proof, but at the end we also derive an important trigonometric identity. In the diagram, A, B, C are the lengths of the sides of a right triangle. The lower case, a, represents the angle opposite of side A.

From the definitions of the common trigonometric functions of sin(a) and cos(a), sin(a) = A/C and cos(a) = B/C. These two equations can be rewritten as A = C sin(a) and B = C cos(a).

On the hypotenuse side of the triangle, C can be broken into two sub-lengths, A’ and B’, which represent the projection of sides A and B, respectively, onto side C.


From the similar triangles that are formed, sin(a) = A’/A and cos(b) = B’/B. These two equations can be rewritten as A’ = A sin(a) and B’ = B cos(a).

Substituting for sin(a) and cos(b), A’= A (A/C) and B’ = B (B/C) or A’ = A2/C and B’ = B2/C.

Given that side C = A’ + B’, we get C = A2/C and B’ = B2/C. Multiplying both sides by C, we now derive the Pythagorean Theorem:

C2 = A2 + B2.

The above proof of the Pythagorean Theorem used the trigonometric functions to derive the terms of A2 and B2. Alternatively, we can keep the sin(a) and cos(a) functions to show another important identity. Returning to the terms for A’ and B’, we can also express these two lengths as A’ = A sin(a) and B’ = B cos(a). Substituting for A and B in these two equations, A’ = C sin(a) sin(a) and B’ = C cos(a) cos(a). Trigonometric convention allows these terms to be stated as A’ = C sin2(a) and B’ = C cos2(a).

Substituting these last two equations into the relationship of side C being the sum of A’ and B’,

C = A’ + B’

C = C sin2(a) + C cos2(a)

Next divide both sides of the equation by C, we now have an important trigonometric identity:

1 = sin2(a) + cos2(a)


Tuesday, May 26, 2020

Find Your Birthday or Phone Number in Pi

Princeton University has a site with the mathematical constant, pi, listed to 10 million digits. Readers are invited to search/find their phone number or other favorite numerical sequence in pi. I found my phone number - 7 digits, not 10-digit number, early in the the full sequence.

Tests of random numbers look for that n-digit length of numerical sequences are found with equal frequency in a sufficiently long sequence. I found my 7-digit phone number, but not unexpectedly, not my full 10-digit number, in the listing of pi. My 7-digit phone number represents one of 10 million listings so I wasn't surprised when my 7-digit number showed up. With a listing of pi's digits to more digits, I might find my full 10-digit phone number.

To try this exercise for yourself, go to the Princeton website linked above, and use your browser's "find on this page" tool to enter the numerical sequence of your choice. For my example, I used Microsoft Edge and the "find" tool is Control-F. Matching sequences on the page are highlighted.

Monday, May 25, 2020

Pi - How Many Digits are Really Needed?


A prior post showed how to estimate pi using random numbers. The spreadsheet linked to the post can estimate pi correctly to about 3 places; however, since each set of random numbers is different, the results will vary. Readers are encouraged to extend the spreadsheet beyond 1000 random numbers to improve the accuracy of the estimation. 

Pi taken out to 50 decimal places is:
3.14159265358979323846264338327950288419716939937510...

Princeton University has a post where the digits of pi are listed to 10 million places. Beyond 100 places does not provide much immediate value. Just using pi to the 50 places listed above, one could calculate the circumference of the observable university to an accuracy smaller than the diameter of a single hydrogen atom. Readers are challenged to verify given that the estimate of the diameter of the observable universe is 8.8 x 10^26 m and the size of a hydrogen atom is about 1 angstrom (1/10,000,000,000 m).

For simple estimations, consider the following approximations and their relative error:

Approximation     Relative Error
3                            .045
22/7                       .0004
355/113                 .00000008

Sunday, May 24, 2020

Using Random Numbers to Estimate Pi


A friend recently asked that I post something about the mathematical constant, pi. It is the ratio of a circle's circumference to it diameter. To fifty digits, pi is 

3.14159265358979323846264338327950288419716939937510...

There have been many methods established for calculating pi. One of the more interesting methods is derived from Euler's solution to the zeta function:

Euler showed that this function, in its limit, is:

This result has been used in number theory to establish the probability (P) of two random numbers being relatively prime (having no common factors greater than 1) is approximately:

Now, if we generate a large number of pairs of random numbers, we can count how many are relatively prime and then use the proportion to estimate pi using the formula:
I wrote a Google Sheet to make this approximation using 1000 pairs of random numbers. A link to this sheet is here and you can try for yourself. To refresh or change the 1000 pairs of numbers, simply update a blank cell in the sheet. In my first estimate, there were 612 of the 1000 pairs that were relatively prime yielding a proportion, P, of 0.612. This gave an approximation of pi of 3.13.



 

An Open Message to the Blog's Fans in Singapore

(Image:  Free 12 singapore icons - Iconfinder ) This past week, more views of this blog were made from Singapore than other country. To ackn...

Popular in last 30 days