I have a simple equations to solve and I want to do it in matlab,however, there are some years, that I didn't use and kinda forgot it. So this
linsolve({(387=mod(324*a+b,601)), (491=mod(381*a+b,601))},{a,b}),
doesn't give me a result, due to an a mistake I am not able to find. the original set of equations is:
(324a+b)mod601=387 (381a+b)mod601=491,
affine cipher apparently. Thank you!
Starting with these equations,
we can conclude that
and therefore (performing the obvious simplifications inside the parentheses on the left-hand side and fully evaluating the right-hand side),
That looks a lot easier to solve than the system of two equations in two variables. Once you know
a
, you can return to one of the original equations and solve forb
.