Solving a system to equations in a specified form

40 views
Skip to first unread message

Madhurima Mukhopadhyay

unread,
Dec 7, 2017, 10:37:37 PM12/7/17
to sage-support
I want to find the value of  h0,h1,h2,h3,h4 such that  (x - a1)*(x-a2)*(x-a3)*(h0+h1*x^1+h2*x^2+h3*x^3+h4*x^4+x^5)=(x+b)*g2+(a*x+d) for some a,b,d,in GF(p). Below is my code which is unable to solve it
a,b,d,a1,a2,a3,h0,h1,h2,h3,h4=var('a b d a1 a2 a3 h0 h1 h2 h3 h4')
RHS= (x - a1)*(x-a2)*(x-a3)*(h0+h1*x^1+h2*x^2+h3*x^3+h4*x^4+x^5)
g2=x^7 + 74604*x^6 + 351974*x^5 + 18952*x^4 + 148817*x^3 + 256076*x^2 + 168356*x +278165
LHS=(x+b)*g2+(a*x+d)
Coeff = RHS.coefficients(x,sparse=False)
print(solve(RHS==LHS, h0,h1,h2,h3,h4))


Please provide me suggestions

slelievre

unread,
Dec 9, 2017, 12:22:45 AM12/9/17
to sage-support
----- Original message (slightly reformatted) ----
I want to find the value of  h0, h1, h2, h3, h4 such that

    (x - a1)*(x - a2)*(x - a3)*(h0 + h1*x^1 + h2*x^2 + h3*x^3 + h4*x^4 + x^5)

is equal to

    (x + b)*g2 + (a*x + d)

for some a, b, d, in GF(p).

Below is my code which is unable to solve it

    a, b, d, a1, a2, a3, h0, h1, h2, h3, h4 = var('a b d a1 a2 a3 h0 h1 h2 h3 h4')
    RHS = (x - a1)*(x - a2)*(x - a3)*(h0 + h1*x^1 + h2*x^2 + h3*x^3 + h4*x^4 + x^5)
    g2 = x^7 + 74604*x^6 + 351974*x^5 + 18952*x^4 + 148817*x^3 + 256076*x^2 + 168356*x + 278165
    LHS = (x + b)*g2 + (a*x + d)
    Coeff = RHS.coefficients(x, sparse=False)
    print(solve(RHS == LHS, h0, h1, h2, h3, h4))

-----

- What is the value of p that you want to work with?
  Or is p also an unknown?

- Why do you define "Coeff"? You don't seem to use it.

Madhurima Mukhopadhyay

unread,
Dec 9, 2017, 12:41:49 AM12/9/17
to sage-s...@googlegroups.com
p=534601 is known
Defining coefficients is redundant , it is to be omitted.
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "sage-support" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/sage-support/EJwZDCyUnjs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> sage-support...@googlegroups.com.
> To post to this group, send email to sage-s...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.
>


--
Madhurima Mukopadhyay
Senior Research Fellow
Applied Statistics Unit
ISI, Kolkata
Reply all
Reply to author
Forward
0 new messages