Math Is Fun Forum
  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#126 2013-04-09 02:22:39

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

It took me the last 24 hrs to generate approximately 14752000 primes


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#127 2013-04-09 04:03:00

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

That is a lot of time.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#128 2013-04-09 04:07:57

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

Do you have any suggestions to do it faster?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#129 2013-04-09 04:09:14

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

What is the way that you are generating yours and what are you using as a language?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#130 2013-04-09 04:21:10

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

Python(ya, its slow)
I am doing it this way

1. Load the previous list of primes(which I made six months ago)
2. Define the miller-rabin with k=7
3. Define the primality test which says whether or not a number is prime by checking whether it is divisible by all the primes which are in the list of primes upto the square root of the given number
4. Let n = the last prime in the list loaded
5. If n = 9999999999, terminate
6. Increment n by 1
7. If miller-rabin claims  n to be prime, proceed to 8, otherwise goto 5
8. If the real primality test claims n to be prime, proceed to 9, otherwise goto 5
9. Write n in the file, goto 5

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#131 2013-04-09 04:28:08

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

There are a couple of possible bottlenecks there.

First how fast is line 8? What method is being used?

Line 6, should be increment by 2.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#132 2013-04-09 04:30:49

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

Ya, thats a. Good point

For 8, reffer 3


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#133 2013-04-09 04:32:43

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

Two tests for primality are redundant.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#134 2013-04-09 04:39:15

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

But the Miller rabin is done at first so as to save time


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#135 2013-04-09 04:43:18

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

Yes but is it really saving time? I would totally go with the Miller - Rabin.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#136 2013-04-09 04:54:16

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

If you would totally go with the miller-rabin, then how would you be sure whether the number you're going through is prime or not?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#137 2013-04-09 05:02:05

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

There are things that are almost certainly true. They are so rare as to be impossible.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#138 2013-04-09 05:10:42

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

bobbym wrote:

Okay, with k = 7 there was less than one chance in 16384 that it was making a mistake.

The risk is not worth it.
I am making a lot more primes than 16384


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#139 2013-04-09 05:17:48

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

Supposing you doubled k? What do you think will happen?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#140 2013-04-09 05:22:51

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

But still, what if I am one of those unlucky guys out of 100000000 who get a wrong result?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#141 2013-04-09 05:27:55

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

By the way, last day at 12:30 at night I told Alokananda that her phone number is the sum of two primes. Than I told her that there are more than 113274 ways of representing that

She was perhaps shocked and said something which translates like "You do such things at night? Are you mad?"
Then she said, "Had it been any other girl, you would have driven them mad. Only because I am Alokananda, I am still not mad"


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#142 2013-04-09 05:29:06

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

If you chose k = 14 then and if you generated 250 000 000 primes you should expect to only have 1 false prime in the list!

If you chose k = 21 you would need to generate 4 billion primes to expect to have 1 wrong!

But still, what if I am one of those unlucky guys

Do you know that you take a gamble like that everyday? You do not get unlucky.

Isn't it better to generate your list knowing there is an extremely tiny chance that one of them is false rather than generating no list that is perfect!


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#143 2013-04-09 05:36:11

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

If I choose k=22, how much time would it take to complete upto 9999999999(10 digits)?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#144 2013-04-09 05:42:57

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

how much time would it take to complete

That is another question. Right now we are dealing with mathematics and Agnishom's mind.

I would use k = 24 and it is extremely unlikely that there will be a false prime in your list.
Anyways, there are ways to now make sure there are no errors.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#145 2013-04-09 05:52:45

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

What are they?


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#146 2013-04-09 05:55:10

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

There are 455052511 primes less than 10 000 000 000. Your list is checked to see if it has that many, then you know there are no errors!

Now we can get to your last line which is possibly another error.


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#147 2013-04-09 07:47:55

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

Error? Its my loop!


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#148 2013-04-09 07:50:26

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

Excuse me, I meant 9.

Do you understand what I am saying about generating the primes?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

#149 2013-04-09 07:52:45

Agnishom
Real Member
From: The Complex Plane
Registered: 2011-01-29
Posts: 14,390
Website

Re: Mathematics jokes

9 says Write n to file, goto 5


'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'
'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'
'Humanity is still kept intact. It remains within.' -Alokananda

Offline

#150 2013-04-09 07:53:40

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 81,747

Re: Mathematics jokes

Okay, hold that for a second. Are you clear why you need only one test? Miller - Rabin will be enough?


In mathematics, you don't understand things. You just get used to them.
I have the result, but I do not yet know how to get it.
All physicists, and a good many quite respectable mathematicians are contemptuous about proof.

Offline

Board footer

Powered by FluxBB