Wednesday, February 27, 2019

An interesting problem in Number Theory and Probability



 

Was just talking to a friend who is a Math prof, when she posed me this question: What is the last digit of the number 7 raised to 85?

 

When you start working that out, 7 raised to 1, ends in 7; raised to 2 ends in 9; raised to 3 ends in 3; and raised to 4 ends in 1; and then the cycle repeats. Therefore for any positive integer n, 7 raised to n ends in 7 when n mod 4 is 1; ends in 9 when n mod 4 is 2; ends in 3 when n mod 4 is 3; and ends in 1 when n mod 4 is 1.

 

In case of 7 raised to 85, 85 modulo 4, is 1. Hence 7 raised to 85 ends in 7.

 

Which is fine, but one needs to generalise that for all numbers.

 

Hence one can ask the question:   for a number a^n   , where both a and n are natural numbers , what is the probability that a^n   ends in 1,2,3,4,5,6,7,8,9, and 0, respectively.

 

Let us first look at each a separately:

 

(a)   For a = any number ending in 1 (the probability of which in a random sample is 0.1) : a^n   will end in 1 all the time (100%)

 

(b)  For a = any number ending in 2 (the probability of which in a random sample is 0.1) : a^n   will end in 2,4,8, and 6 , 25% of the time each.

 

( c ) For a = any number ending in 3 : a^n   will end in 3,9,7 and 1, 25% of the time each

 

(d) For a = any number ending in 4: a^n   will end in 4 and 6, 50% of the time each

 

(e) For a = any number ending in 5: a^n   will end in 5 hundred percent of the time

 

(f) For a = any number ending in 6: a^n   will end in 6 hundred percent of the time

 

(g) For a = any number ending in 7: a^n   will end in 7,9,3 and 1, 25% of the time each

 

(h) For a = any number ending in 8: a^n   will end in 8,4,2 and 6, 25% of the time each

 

(i)             For a = any number ending in 9: a^n   will end in 9 and 1, 50% of the time each

 

(j) For a = any number ending in 0 (not being 0, since we defined a and n as Natural Numbers): a^n   will end in 0 hundred percent of the time.

 

Now computing each of the probabilities of a^n   ending in :

 

1: 0.1 x 1 (a) plus 0.1 x 0.25 (c ) plus 0.1 x 0.25 (g) plus 0.1 x 0.5 ( i) = 0.1 x 2 = 20 percent

 

Applying the same method, we get the probability that a^n   ends in

1: is 20 percent

2: is 5 percent

3: is 5 percent

4: is 10 percent

5: is 10 percent

6: is 20 percent

7: is 5 percent

8: is 5 percent

9: is 10 percent

0: is 10 percent

 

I also ran a simulation in excel with a sample size of 1000 randomly generated a^n   . The resulting frequency table closely matches my result, hence I think my answer should be correct.

 

The frequency table generated through a Monte Carlo:

 

endnos.

frequency

my answer

0

10.241%

10%

1

19.177%

20%

2

4.618%

5%

3

4.719%

5%

4

11.044%

10%

5

10.341%

10%

6

20.181%

20%

7

4.217%

5%

8

5.422%

5%

9

10.040%

10%

 

 

Your comments are welcome.

 

Tuesday, February 12, 2019

Thoughts on BRexit

Imagine you are standing in front of an oncoming train which is ten minutes away. You are going to die, you know that. How you got into that precarious position is because you voted to be there. Why you voted to be there is because the alternative was to continue on a boat where your fellow passengers were the French and the Germans, which, as everyone knows, is intolerable.

You can vote to get back into the boat, but the people in the boat will then lose any respect they had for you, which, you don't realize was zero, so there is actually nothing further to lose.

Now, the oncoming train. You and your fellow group of superior mortals (for you consider yourselves so) have other choices. You can choose to walk towards the train, and it will hit you. That will be your last BReath, or BRexit. Or you can choose to get back into the boat. But you just voted to get out, says one of you. But the train will hit us, says another. But the whole world is watching how grandly and majestically we handle these things, after all we taught manners and etiquette to so many natives all over the world, says another. Get back into the boat, says a small voice inside everyone. But that same voice says that the boat is inexorably heading towards a rocky island, and no one is steering it away, since the officers have locked the rudder in that position, and they are having meetings on board to discuss the issue. But the train is coming, say you, in ten minutes. So, what do you want us to do, go meet it, says another, let us have a discussion. No, a referendum, says another.

And, so one more glorious race on which the sun never set, vanished from the face of the earth. History will record it as the first instance of a race voting themselves into extinction.