Question: Wrong Results Returned

The only difference between the code that works and the code that doesnt, is that in one Identity is rearranged to as such that the rhs is 0, i am really really curious to work out why this occurs, the only difference is that one evaluates to 1/2=1/2, and the other evaluates to 0=0, but i dont see why maple would return one of those evaluations as false
 

``

 

 

delta(x, y) = piecewise(x = y, 1, x <> y, 0)

 

{x}*is*the*fractional*part*of*x

 

``

 

 

`&Mscr;`(p, q) = {`mod`(p, q)+(1/4)*q*(q-1)}

"`&Dscr;`(q)="
1-(delta({(1/4)*q}, 0)+delta({(1/4)*q}, 0))+delta({(1/4)*q}, 0)*delta({(q-1)*(1/4)}, 0)+1/2*(delta({(q-2)*(1/4)}, 0)+delta({(1/4)*q}, 0)-delta({(q-2)*(1/4)}, 0)*delta({(q-3)*(1/4)}, 0))

 

 

CONJECTURE: c`in`(p, q, nonnegint^2)", `&Mscr;`(p,q)=`&Dscr;`(q)"

 

CHALLENGE: FIND: `in`(p, q, integer^2*such*that*`&Mscr;`(p, q)) and integer^2*such*that*`&Mscr;`(p, q) <> `&Dscr;`(p, q)

 

 

2, 3, 6, 7, 10, 11, 14, 15, 18, 19

 

{`mod`(p[i], p[j])+(1/4)*p[j]*(p[j]-1)} = 1-delta({(1/4)*p[j]}, 0)-delta({(p[j]-1)*(1/4)}, 0)+delta({(1/4)*p[j]}, 0)*delta({(p[j]-1)*(1/4)}, 0)+1/2*(delta({(p[j]-2)*(1/4)}, 0)+delta({(p[j]-3)*(1/4)}, 0)-delta({(p[j]-2)*(1/4)}, 0)*delta({(p[j]-3)*(1/4)}, 0))

 

 

{`mod`(p[i], p[j])+(1/4)*p[j]*(p[j]-1)} = 1-delta({(1/4)*p[j]}, 0)-delta({(p[j]-1)*(1/4)}, 0)+delta({(1/4)*p[j]}, 0)*delta({(p[j]-1)*(1/4)}, 0)+1/2*(delta({(p[j]-2)*(1/4)}, 0)+delta({(p[j]-3)*(1/4)}, 0)-delta({(p[j]-2)*(1/4)}, 0)*delta({(p[j]-3)*(1/4)}, 0))

2, 3, 6, 7, 10, 11, 14, 15, 18, 19

Numbers congruent to 2 or 3 mod 4.

 

NULL

NULL

WHEN ALL TERMS ARE PLACED ON THE LHS AND 0 ON THE OTHER, THE OUTPUT PLACES ALL p,q IN THE SET T, AS I EXPECTED.

restart; S := {}; with(combinat); with(numtheory); T := {}; F := {}; C := {}; AlphaTotal := {}; BetaTotal := {}

delta := proc (x, y) options operator, arrow; piecewise(x = y, 1, x <> y, 0) end proc

Identity := proc (p, q) options operator, arrow; frac(`mod`(p, q)+(1/4)*q*(q-1))+delta(frac((1/4)*q), 0)+delta(frac((1/4)*q-1/4), 0)-delta(frac((1/4)*q), 0)*delta(frac((1/4)*q-1/4), 0)+(1/2)*delta(frac((1/4)*q-1/2), 0)+(1/2)*delta(frac((1/4)*q-3/4), 0)-(1/2)*delta(frac((1/4)*q-1/2), 0)*delta(frac((1/4)*q-3/4), 0)-1 = 0 end proc

NULL

GenerateOddPrimeNumberPairs := proc (N) options operator, arrow; choose([seq(ithprime(k), k = 1 .. N)], 2) end proc

AssignToTrueOrFalseSet := proc (x, y) global T, F; if is(Identity(x, y)) = true then T := `union`({[x, y]}, T) else F := `union`({[x, y]}, F) end if end proc

QueryIdentity := proc (N) local P, k; P := GenerateOddPrimeNumberPairs(N); for k to nops(P) do AssignToTrueOrFalseSet(P[k][1], P[k][2]) end do end proc

QueryIdentity(20); T; F

{[2, 3], [2, 5], [2, 7], [2, 11], [2, 13], [2, 17], [2, 19], [2, 23], [2, 29], [2, 31], [2, 37], [2, 41], [2, 43], [2, 47], [2, 53], [2, 59], [2, 61], [2, 67], [2, 71], [3, 5], [3, 7], [3, 11], [3, 13], [3, 17], [3, 19], [3, 23], [3, 29], [3, 31], [3, 37], [3, 41], [3, 43], [3, 47], [3, 53], [3, 59], [3, 61], [3, 67], [3, 71], [5, 7], [5, 11], [5, 13], [5, 17], [5, 19], [5, 23], [5, 29], [5, 31], [5, 37], [5, 41], [5, 43], [5, 47], [5, 53], [5, 59], [5, 61], [5, 67], [5, 71], [7, 11], [7, 13], [7, 17], [7, 19], [7, 23], [7, 29], [7, 31], [7, 37], [7, 41], [7, 43], [7, 47], [7, 53], [7, 59], [7, 61], [7, 67], [7, 71], [11, 13], [11, 17], [11, 19], [11, 23], [11, 29], [11, 31], [11, 37], [11, 41], [11, 43], [11, 47], [11, 53], [11, 59], [11, 61], [11, 67], [11, 71], [13, 17], [13, 19], [13, 23], [13, 29], [13, 31], [13, 37], [13, 41], [13, 43], [13, 47], [13, 53], [13, 59], [13, 61], [13, 67], [13, 71], [17, 19], [17, 23], [17, 29], [17, 31], [17, 37], [17, 41], [17, 43], [17, 47], [17, 53], [17, 59], [17, 61], [17, 67], [17, 71], [19, 23], [19, 29], [19, 31], [19, 37], [19, 41], [19, 43], [19, 47], [19, 53], [19, 59], [19, 61], [19, 67], [19, 71], [23, 29], [23, 31], [23, 37], [23, 41], [23, 43], [23, 47], [23, 53], [23, 59], [23, 61], [23, 67], [23, 71], [29, 31], [29, 37], [29, 41], [29, 43], [29, 47], [29, 53], [29, 59], [29, 61], [29, 67], [29, 71], [31, 37], [31, 41], [31, 43], [31, 47], [31, 53], [31, 59], [31, 61], [31, 67], [31, 71], [37, 41], [37, 43], [37, 47], [37, 53], [37, 59], [37, 61], [37, 67], [37, 71], [41, 43], [41, 47], [41, 53], [41, 59], [41, 61], [41, 67], [41, 71], [43, 47], [43, 53], [43, 59], [43, 61], [43, 67], [43, 71], [47, 53], [47, 59], [47, 61], [47, 67], [47, 71], [53, 59], [53, 61], [53, 67], [53, 71], [59, 61], [59, 67], [59, 71], [61, 67], [61, 71], [67, 71]}

 

{}

(1)

BUT WHEN THE EQUALITY IS DEFINED AS FOLLOWS, SOME RESULTS ARE PLACED IN THE F SET. (INDICATING THE EQUALITY FOR ALL [p,q] is FALSE)

restart; S := {}; with(combinat); with(numtheory); T := {}; F := {}; C := {}; AlphaTotal := {}; BetaTotal := {}

delta := proc (x, y) options operator, arrow; piecewise(x = y, 1, x <> y, 0) end proc

Identity := proc (p, q) options operator, arrow; frac(`mod`(p, q)+(1/4)*q*(q-1)) = 1-delta(frac((1/4)*q), 0)-delta(frac((1/4)*q-1/4), 0)+delta(frac((1/4)*q), 0)*delta(frac((1/4)*q-1/4), 0)+(1/2)*delta(frac((1/4)*q-1/2), 0)+(1/2)*delta(frac((1/4)*q-3/4), 0)-(1/2)*delta(frac((1/4)*q-1/2), 0)*delta(frac((1/4)*q-3/4), 0) end proc:

``

GenerateNumberPairs := proc (N) options operator, arrow; choose([seq(ithprime(k), k = 1 .. N)], 2) end proc:

AssignToTrueOrFalseSet := proc (x, y) global T, F; if is(Identity(x, y)) = true then T := `union`({[x, y]}, T) else F := `union`({[x, y]}, F) end if end proc:

QueryIdentity := proc (N) local P, k; P := GenerateNumberPairs(N); for k to nops(P) do AssignToTrueOrFalseSet(P[k][1], P[k][2]) end do end proc:

QueryIdentity(20):

{[2, 5], [2, 13], [2, 17], [2, 29], [2, 37], [2, 41], [2, 53], [2, 61], [3, 5], [3, 13], [3, 17], [3, 29], [3, 37], [3, 41], [3, 53], [3, 61], [5, 13], [5, 17], [5, 29], [5, 37], [5, 41], [5, 53], [5, 61], [7, 13], [7, 17], [7, 29], [7, 37], [7, 41], [7, 53], [7, 61], [11, 13], [11, 17], [11, 29], [11, 37], [11, 41], [11, 53], [11, 61], [13, 17], [13, 29], [13, 37], [13, 41], [13, 53], [13, 61], [17, 29], [17, 37], [17, 41], [17, 53], [17, 61], [19, 29], [19, 37], [19, 41], [19, 53], [19, 61], [23, 29], [23, 37], [23, 41], [23, 53], [23, 61], [29, 37], [29, 41], [29, 53], [29, 61], [31, 37], [31, 41], [31, 53], [31, 61], [37, 41], [37, 53], [37, 61], [41, 53], [41, 61], [43, 53], [43, 61], [47, 53], [47, 61], [53, 61], [59, 61]}

 

{[2, 3], [2, 7], [2, 11], [2, 19], [2, 23], [2, 31], [2, 43], [2, 47], [2, 59], [2, 67], [2, 71], [3, 7], [3, 11], [3, 19], [3, 23], [3, 31], [3, 43], [3, 47], [3, 59], [3, 67], [3, 71], [5, 7], [5, 11], [5, 19], [5, 23], [5, 31], [5, 43], [5, 47], [5, 59], [5, 67], [5, 71], [7, 11], [7, 19], [7, 23], [7, 31], [7, 43], [7, 47], [7, 59], [7, 67], [7, 71], [11, 19], [11, 23], [11, 31], [11, 43], [11, 47], [11, 59], [11, 67], [11, 71], [13, 19], [13, 23], [13, 31], [13, 43], [13, 47], [13, 59], [13, 67], [13, 71], [17, 19], [17, 23], [17, 31], [17, 43], [17, 47], [17, 59], [17, 67], [17, 71], [19, 23], [19, 31], [19, 43], [19, 47], [19, 59], [19, 67], [19, 71], [23, 31], [23, 43], [23, 47], [23, 59], [23, 67], [23, 71], [29, 31], [29, 43], [29, 47], [29, 59], [29, 67], [29, 71], [31, 43], [31, 47], [31, 59], [31, 67], [31, 71], [37, 43], [37, 47], [37, 59], [37, 67], [37, 71], [41, 43], [41, 47], [41, 59], [41, 67], [41, 71], [43, 47], [43, 59], [43, 67], [43, 71], [47, 59], [47, 67], [47, 71], [53, 59], [53, 67], [53, 71], [59, 67], [59, 71], [61, 67], [61, 71], [67, 71]}

(2)

BUT CHECKING THESE RESULTS 'MANUALLY' CONFIRMS THE EQUALITY IS INDEED TRUE FOR ALL ODD PRIME PAIRS  p,q.

{seq(F[k][2], k = 1 .. nops(F))}

{3, 7, 11, 19, 23, 31, 43, 47, 59, 67, 71}

(3)

seq(frac(`mod`(F[k][1], F[k][2])+(1/4)*F[k][2]*(F[k][2]-1)), k = 1 .. nops(F))

1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2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2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2, 1/2

(5)

[seq(frac(`mod`(T[k][1], T[k][2])+(1/4)*T[k][2]*(T[k][2]-1)), k = 2 .. nops(T))]

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

(6)

seq(frac(-delta(frac((1/4)*T[k][2]), 0)-delta(frac((T[k][2]-1)*(1/4)), 0)+delta(frac((1/4)*T[k][2]), 0)*delta(frac((T[k][2]-1)*(1/4)), 0)+1/2*(delta(frac((T[k][2]-2)*(1/4)), 0)+delta(frac((T[k][2]-3)*(1/4)), 0)-delta(frac((T[k][2]-2)*(1/4)), 0)*delta(frac((T[k][2]-3)*(1/4)), 0))+1), k = 1 .. nops(F))

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

(7)

``


 

Download KRONECKER_delta_RECIPROCITY.mw

Please Wait...