Problem 42385. Combined Ages 4 - Non-symmetric with multiples, n ≥ 3
This problem is slightly more difficult than Combined Ages 3. In this case, some of the sums may include multiples of some individuals' ages. As an example: If the ages of all three individuals with Chris's age added again sum to 98, the ages of Barry (twice) and Chris sum to 84, and the ages of Alex (twice) and Barry sum to 70, what are their individual ages?
The individuals will be represented by the first n capital letters of the alphabet and the sums will be represented by variables whose string names contain each associated individual (capital letter). In this example problem, the equations would be represented as:
- A+B+C+C = ABCC (= 98)
- B+B+C = BBC (= 84)
- A+A+B = AAB (= 70)
Though the variables are ordered above, they will not always be in the test cases. Write a function to return the individuals' ages based on the supplied sums. See the test suite for examples and the tags for some hints.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers75
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15600 Solvers
-
Read a column of numbers and interpolate missing data
2313 Solvers
-
Return unique values without sorting
934 Solvers
-
Sum of odd numbers in a matrix
586 Solvers
-
Find out sum of all elements of given Matrix
507 Solvers
More from this Author139
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!