Professional Documents
Culture Documents
Assignment4 210997
Assignment4 210997
Shrey Bansal
Roll No. 210997
Solution :
We can use an algorithm which picks a random polynomial f (x) of degree d and checks
if it is irreducible or not.
2. Test if f is irreducible.
3. If not, go to step 1.
g ← gcd(h, f )
if g ̸= 1 then
return false
STOP
end if
end for
g ← xp − x mod f
d
if g = 0 then
return true
else
return false
end if
What is the size of your input and output? Is your algorithm fast, or practical?
Solution:
1
CS201 Assignment 4
• In this randomized algorithm, the input is prime p and d ∈ N>0 which takes up
O(1) space.
• The function to check whether f (x) is irreducible or not takes f (x), a monic
polynomial of degree d, prime p and d as its input, which takes up O(d) space.
Working :
• This algorithm is valid since we know that ∀ prime p and d ∈ N>0 , a degree d
irreducible polynomial will exist and it has a good density of d1 in the field Fpd .
• Firstly, we know that all irreducibles of degree t such that t | d are a factor of
xp − x, so for f (x) to be irreducible, it must be co-prime to all such xp − x
d t
operations. Using fast arithmetic gives complexity O(n log n) for multiplication
and division.
√
• The loop runs for O( d) opertaions, which is the order of number of divisors
of d.
⇒ The loop runs for about d2.5 (d+ log p) operations.
Solution:
What is the size of your input and output? Is your algorithm fast, or practical?
Solution: