
David W. answered 01/30/22
Experienced Prof
Let I = number of Indians
T = number of Turks
C = number of Chinese
G = number of Germans
A = number of Australians
E = total number of employees
E = I + T + C + G + A
I = (1/3)G – 1 “Indians are one less than one-third the number of germans”
I = (1/2)A – 3 “three less than half the numbers of Australians”
T + G = (C + A) + 3 “turks and germans together outnumber the Chinese and Australians by 3”
C + G = (1/2)E – 1 “Chinese and germans form one less than half the group.”
A + C = (7/16)E “Australians and Chinese form 7/16 of the company”
Rewrite the equations with 0 on the right side:
I + T + C + G + A = E … [eq.1]
3I - G + 3 = 0 … [eq.2]
2I - A + 6 = 0 … [eq.3]
T - C + G - A - 3 = 0 … [eq.4]
2C + 2G - E + 2 = 0 … [eq.5]
16C + 16A -7E = 0 … [eq.6]
How many people of each nationality are employed in this company?
The typical math course solution would be to multiply some equations by a constant, then add or subtract those equations (the ELIMINATION METHOD) until only one variable remains. Then, use that value to solve for another variable, then another, until all values are found.
To use ELIMINATION to solve the system of equations, we must find equations, when combined, will eliminate all variables but one.
Since we defined E to be the sum of the five other variables, let’s re-write the five other equations:
3I - G + 3 = 0 … [eq.2]
2I - A + 6 = 0 … [eq.3]
T - C + G - A + 3 = 0 … [eq.4]
I + T - C - G + A - 2 = 0 [eq.5]
7I + 7T - 9C + 7G - 9A = 0 [eq.6]
Now, looking at the sparse equations (eq2 and eq3), we realize that eq4 can be expressed using only variables I,T and C.
G = 3I + 3
A = 2I + 6
T - C + G - A + 3 = 0
T – C + (3I + 3) – (2I + 6) + 3 = 0
T – C + I – 6 = 0
C = T + I – 6
Putting that expression into eq5 and eq6, leaves only eq5 and eq6 with variables I and T, which can be easily solved. Then, we can solve for the other variables using the other equations.
I + T – C – G + A – 2 = 0
I + T – (T+I-6) – (3I+3) + (2I+6) – 2 = 0
I + T -T – I + 6 – 3I -3 + 2I + 6 – 2 = 0
I = 7
G = 3I +3
G=24
A=2I+6
A=20
C = T + I – 6
C = T+1
7I + 7T - 9C + 7G - 9A = 0
7(7) + 7T – 9(T+1) + 7(24) – 9(20) = 0
49 + 7T – 9T – 9 + 168 – 180 = 0
28 = 2T
T = 14
C = T+1
C = 15
NOTE: These equations may be combined in a different order.
Answers: I = 7, T = 14, C = 15, G = 24, A = 20, E = 80
Another method is to assume that all values are integers (whole number of people). Eq.2 says that G is a multiple of 3. Eq.3 says that A is even. Eq.6 says that E is a multiple of 16. Let’s see whether there are values less than 100 that solves this problem:
for g in range(3, 100, 3):
i = float(g) / 3 - 1
for a in range(2, 100, 2):
if i == float(a) / 2 - 3:
for t in range(1, 100, 1):
for c in range(1, 100, 1):
if t + g == c + a + 3:
e = i + t + c + g + a
if c + g == float(e) / 2 - 1:
if a + c == float(7 * e) / 16:
print(str(i) + " " + str(t) + " " + str(c) + " " + str(g) + " " + str(a) + " " + str(e))
print("done")
= = = =
7 14 15 24 20 80
done

Elysian W.
Thank you so much sir01/31/22
Luke J.
Cool solution and would never have thought to computer program a linear algebra problem! But I like it a lot! I was going to critique that you didn't have it display which value is for which named variable, but it's nested in the 'print' command01/30/22