Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.8K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Use the replacement rule to replace the values of W, X, Y, Z in these eqs.?

Posted 8 years ago

I calculated W X Y Z by solving 4 equations

The result are 4 substitution rules.

estratti = {16, 19, 35, 53, 23};

m = 19;

a = Extract[estratti, 1];
b = Extract[estratti, 2];
c = Extract[estratti, 3];
d = Extract[estratti, 4];
e = Extract[estratti, 5];

Solve[a*m + w == b, {w}, Modulus -> 90]

Solve[b*m + x == c, {x}, Modulus -> 90]

Solve[c*m + y == d, {y}, Modulus -> 90]

Solve[d*m + z == e, {z}, Modulus -> 90]

Reduce[{a + w*m + g == 0, b*m + g == 0}, {g}, Modulus -> 90]

Reduce[{a*m + w + x*m + h == 0, b + x*m + h == 0}, {h}, 
 Modulus -> 90]

Reduce[{a*m + w + x*m + i == 0, c*m + i == 0}, {i}, Modulus -> 90]

Reduce[{b + x*m + j == 0, c*m + j == 0}, {j}, Modulus -> 90]

In the last 4 equations I want to replace the values of W X Y Z with the previous results.

I tried:

• FLATTEN to remove the double parenthesis {{}}

• assigning a NAME, then PART to extract from: NAME = {{w-> 75}} the rule {w-> 75}

• use the PART obtained as replacement /. NAME [[1]], but I always get C [1] in the solutions.

I want to get only the INTEGER value of G H I, without x = C [1]

Manually replacing the letters with their respective numeric values all works.

Thank you.

POSTED BY: pisa livorno
2 Replies
Posted 8 years ago

tnk's

POSTED BY: pisa livorno
Posted 8 years ago

This

{a, b, c, d, e} = {16, 19, 35, 53, 23};
m = 19;
Reduce[{a+w m+g==0, b m+g==0}/.Solve[a m+w==b, w, Modulus->90][[1]], g, Modulus->90]
Reduce[{a m+w+x m+h==0, b+x*m+h==0}/.Solve[b m+x==c, x, Modulus->90][[1]], h, Modulus->90]
Reduce[{a m+w+x m+i==0, c*m+i==0} /. Solve[c m+y==d, y, Modulus->90][[1]], i, Modulus->90]
Reduce[{b+x m+j==0, c m+j==0}/.Solve[d m+z==e, z, Modulus->90][[1]], j, Modulus->90]

produces this

g == 89
w == 75 && h == 55
w == C[1] && x == 19 + 71 C[1] && i == 55
x == 34 && j == 55

with no manual steps needed.

Your third equation Solves for y, but y is then not present in the equation you Reduce.

You could replace that line with

Reduce[{a m+w+x m+i==0, c*m+i==0} /. Solve[c m+y==d, y, Modulus->90][[1]], i, Modulus->90]/.C[1]->0

if you wanted to replace C[1] with zero, or use any other value instead of zero for a different solution.

POSTED BY: Bill Simpson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard