You are currently browsing the tag archive for the ‘random number generators’ tag.

If you are a teacher then please also visit my new site: intermathematics.com for over 2000+ pdf pages of resources for teaching IB maths!

**Normal Numbers – and random number generators**

Numberphile have a nice new video where Matt Parker discusses all different types of numbers – including “normal numbers”. Normal numbers are defined as irrational numbers for which the probability of choosing any given 1 digit number is the same, the probability of choosing any given 2 digit number is the same etc. For example in the normal number 0.12345678910111213141516… , if I choose any digit in the entire number at random P(1) = P(2) = P(3) = … P(9) = 1/10. Equally if I choose any 2 digit number at random I have P(10) = P(11) = P(12) = P(99) = 1/100.

It is incredibly hard to find normal numbers, but there is a formula to find some of them.

In base 10, we are restricted to choosing a value of c such that 10 and c are relatively prime (i.e share no common factors apart from 1). So if we choose c = 3 this gives:

We can now put this into Wolfram Alpha and see what number this gives us:

So we can put the first few digits into an online calculator to find the distributions

*0.000333333444444444444448148148148148148148148148148148148148148149382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049827160493827160493827160479423863312 7572016460905349794238683127572016460905349794238683127572016460 9053497942386831275720164609053497942386831275720164609053497942*

4: 61

1: 41

8: 40

3: 38

0: 36

2: 33

7: 33

9: 33

6: 32

5: 10

We can see that we are already seeing a reasonably similar distribution of single digits, though with 4 and 5 outliers. As the number progressed we would expect these distributions to even up (otherwise it would not be a normal number).

One of the potential uses of normal numbers is in random number generators – if you can use a normal number and specify a digit (or number of digits) at random then this should give an equal chance of returning each number.

To finish off this, let’s prove that the infinite series:

does indeed converge to a number (if it diverged then it could not be used to represent a real number). To do that we can use the ratio test (only worry about this bit if you have already studied the Calculus Option for HL!):

We can see that in the last limit 3 to the power n+1 will grow faster than 3 to the power n, therefore as n increases the limit will approach 0. Therefore by the ratio test the series converges to a real number.

**Is pi normal?**

Interestingly we don’t know if numbers like e, pi and ln(2) are normal or not. We can analyse large numbers of digits of pi – and it looks like it will be normal, but as yet there is no proof. Here are the distribution of the first 100,000 digits of pi:

1: 10137

6: 10028

3: 10026

5: 10026

7: 10025

0: 9999

8: 9978

4: 9971

2: 9908

9: 9902

Which we can see are all very close to the expected value of 10,000 (+/- around 1%).

So, next I copied the first 1 million digits of pi into a character frequency counter which gives the following:

5: 100359

3: 100230

4: 100230

9: 100106

2: 100026

8: 99985

0: 99959

7: 99800

1: 99758

6: 99548

This is even closer to the expected values of 100,000 with most with +/- 0.25 %.

Proving that pi is normal would be an important result in number theory – perhaps you could be the one to do it!

**Essential Resources for IB Teachers**

If you are a **teacher** then please also visit my new site. This has been designed specifically for teachers of mathematics at international schools. The content now includes over **2000 pages of pdf content** for the entire SL and HL Analysis syllabus and also the SL Applications syllabus. Some of the content includes:

**Original pdf worksheets**(with full worked solutions) designed to cover all the syllabus topics. These make great homework sheets or in class worksheets – and are each designed to last between 40 minutes and 1 hour.**Original Paper 3 investigations**(with full worked solutions) to develop investigative techniques and support both the exploration and the Paper 3 examination.- Over 150 pages of
**Coursework Guides**to introduce students to the essentials behind getting an excellent mark on their exploration coursework. - A large number of
**enrichment activities**such as treasure hunts, quizzes, investigations, Desmos explorations, Python coding and more – to engage IB learners in the course.

There is also a lot more. I think this could save teachers 200+ hours of preparation time in delivering an IB maths course – so it should be well worth exploring!

**Essential Resources for both IB teachers and IB students**

1) Exploration Guides and Paper 3 Resources

I’ve put together a **168 page** Super Exploration Guide to talk students and teachers through all aspects of producing an excellent coursework submission. Students always make the same mistakes when doing their coursework – get the inside track from an IB moderator! I have also made **Paper 3 packs** for HL Analysis and also Applications students to help prepare for their Paper 3 exams. The Exploration Guides can be downloaded here and the Paper 3 Questions can be downloaded here.