My kid came up with something about prime numbers and I don't know if he's correct :D

Hey Folks,

I'm not a math head, but I have a 10 year old who is. He loves the stuff. He came to me with something which I'm pretty sure is wrong (still pretty impressed that he's even thinking about this stuff).

He proposes that the probability of any random number pulled out of a hat being prime is (1/n!)/n . n being the number pulled.

The idea is that knowing anything about numbers at all, no sieves, no fancy algorithms, just a brute force test of the number dividing it by all it's potential factors yields a series from 1 to n.

So if your number is 5, you get a series like: 1/1 * 1/2 * 1/3 * 1/4 * 1/5.

The idea is that the probability of n NOT being divisible by any of its possible factors is (1/n!)/n. We need to add the /n because n is included in the series.

I see his general reasoning tho I'm not sure about the final equation haha.

I was wondering if anyone here could help me explain to him in a concise way where his assumptions went wrong (or right!) and what a better way to think of the problem would be.

UPDATE: I shared all your kind words of encouragement with my son and showed him the information you all posted regarding how to improve his function.

I did want to share that I posted the original equation wrong, it should have been 1/(n!/n) which is equivalent to 1/(n-1)!.

In any case, we plugged in 10 and showed how the denominator was way to large and resulted in a probability near zero. Then we discussed how doing n! resulted in WAY to many unnecessary comparisons.

So I showed him how what we really want to do is compare to a 1/2, 3/4, 4/5, etc. He totally got this and we got to a better approximation of 1/(n-1). Then we discussed how this also results in way too many comparisons because, as others have explained, once you test 1/2 you don't need to test 4 etc.

I demonstrated how testing above the sqrt(n) isn't necessary and we could cap our test there, thus ending up at 1/sqrt(n).

I showed him the real prime theorem and he was so stoked to see it. He's totally inspired to learn all the math necessary to thoroughly understand it!

Thanks everyone for being so awesome!