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

You are not logged in.

#1 2013-04-06 03:47:40

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

Miller-Rabin

Somebody please explain me the Miller Rabin Primality test


'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

#2 2013-04-06 03:49:04

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

It is a probabilistic test for determining primality belonging to the field of computational number theory.


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

#3 2013-04-06 03:59:50

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

Re: Miller-Rabin

Yes, how to do it?


'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

#4 2013-04-06 04:03:23

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

For once Wiki actually did a good job explaining something!!!!

Input: n > 3, an odd integer to be tested for primality;
Input: k, a parameter that determines the accuracy of the test
Output: composite if n is composite, otherwise probably prime

Go:
write n − 1 as 2^s·d with d odd by factoring powers of 2 from n − 1
WitnessLoop: repeat k times:
   pick a random integer a in the range [2, n − 2]
   x ← ad mod n
   if x = 1 or x = n − 1 then do next WitnessLoop
   repeat s − 1 times:
      x ← x^2 mod n
      if x = 1 then return composite
      if x = n − 1 then do next WitnessLoop
   return composite
return probably prime

Can not do any better than that except to do some filling in.


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

#5 2013-04-06 04:07:31

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

Re: Miller-Rabin

And what does this method actually rely on?


'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

#6 2013-04-06 04:11:26

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

A whole lot of number theory and a thing called a strong pseudo prime.


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

#7 2013-04-06 04:14:47

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

Re: Miller-Rabin

Mainly fermat's little theorem?
And what ensures it is strong?


'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

#8 2013-04-06 04:21:42

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Offhand I never remember that definition of them but I could look it up.

More to the point is the test itself and the fact that it is a non deterministic test.


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

#9 2013-04-06 04:32:09

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

Re: Miller-Rabin

Not the definition but I am asking what gives them a HIGH probability of being prime?


'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

#10 2013-04-06 04:37:16

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

That I do not remember. I am sorry.


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

#11 2013-04-06 04:54:02

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

Re: Miller-Rabin

Thats okay.
Once I know that a number is probably prime, how do I make sure?


'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

#12 2013-04-06 04:58:45

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Three of your countryman developed the AKS algorithm which is deterministic and fast. Or you can use 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

#13 2013-04-06 05:07:04

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

Re: Miller-Rabin

Three of my countrymen? Who 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

#14 2013-04-06 05:10:34

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Manindra Agrawal, Neeraj Kayal, and Nitin Saxena


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

#15 2013-04-06 05:26:47

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

Re: Miller-Rabin

I did not know them.

I shall google it


'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

#16 2013-04-06 05:33:22

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Are they all three Indians?


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

#17 2013-04-06 05:45:33

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

Re: Miller-Rabin

The names sound so, but how does it matter?


'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

#18 2013-04-06 05:46:42

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

It matters in the sense that I like to differ from the rest of my kind.


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

#19 2013-04-06 05:54:48

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

Re: Miller-Rabin

Would that change the method essentially?


'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

#20 2013-04-06 05:59:57

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Change the method? I am not understanding you.


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

#21 2013-04-06 06:02:07

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

Re: Miller-Rabin

Me neither big_smile


'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

#22 2013-04-06 06:09:18

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

The AKS proves a number is prime while the Miller Rabin tells the probability it is prime.


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

#23 2013-04-06 13:08:59

anonimnystefy
Real Member
From: The Foundation
Registered: 2011-05-23
Posts: 14,860

Re: Miller-Rabin

Or we could just wait for someone to solve the P vs NP problem.


“Here lies the reader who will never open this book. He is forever dead.

“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment

Offline

#24 2013-04-06 15:48:29

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

Re: Miller-Rabin

Who will bell the cat?


'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

#25 2013-04-06 19:39:53

bobbym
Administrator
From: Bumpkinland
Registered: 2009-04-12
Posts: 82,610

Re: Miller-Rabin

Did you have anymore questions about 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

Board footer

Powered by FluxBB