Each of a, b, c, and d is an integer that satisfies this system of equations:
ab+cd = 34
ac-bd =19
Determine all possible values of a, b, c, and d.
First I let one of the variables (b) be zero:
cd = 34
ac = 19
34/d = 19/a --> a=19, b=0, c=1, d=34 one solution
Then, a brute force checking values from 0 to ±200.
There are really only two base solutions, plus variations as shown below.
The two solutions are:
(19, 0, 1, 34) found analytically by setting 'b' equal to 0.
(6, 5, 4, 1) found by computer
For any solution (a, b, c, d), the following will also be 7 variations:
(b, a, -d, -c)
(c, d, a, b)
(d, c, -b, -a)
(-d, -c, b, a)
(-c, -d, -a, -b)
(-b, -1, d, c)
(-a, -b, -c, -d)
Program output (16 solutions):
-34 -1 0 19
-19 0 -1 -34
-6 -5 -4 -1
-5 -6 1 4
-4 -1 -6 -5
-1 -34 -19 0
-1 -4 5 6
0 -19 34 1
0 19 -34 -1
1 4 -5 -6
1 34 19 0
4 1 6 5
5 6 -1 -4
6 5 4 1
19 0 1 34
34 1 0 -19
----------
solutions = []
hi = 50
lo = - hi
for a in range(lo,hi):
for b in range(lo,hi):
for c in range(lo,hi):
for d in range(lo,hi):
if a*b+c*d != 34:
continue
if a*c-b*d != 19:
continue
solutions.append([a,b,c,d])
print(a,b,c,d)
----------
I also used a more efficient program disallowing any variable from being zero and checked up to ±200 with no additional results.
|
Posted by Larry
on 2024-06-01 09:20:28 |