Wikipedia:Reference desk/Archives/Mathematics/2021 November 29

= November 29 =

Escape room balance puzzle
The four colours represent integer weights, not necessarily distinct, from 0 to 9 inclusive. What's a simple way to deduce the weight of each colour without trial-and-error or backtracking? Thanks, cm&#610;&#671;ee&#9094;&#964;a&#671;&#954; 15:23, 29 November 2021 (UTC)
 * If I'm interpreting the diagram correctly, we get the following relations: b < g, y < g, 2r < y, b+g = y+2r, y+g = 3b. Looking at the second equation, since y and g are distinct (by the second inequality), their sum is at most 17.  So b is at most 5.
 * Combining the first equation with the second inequality gives b < 2r.
 * Subtracting the two equations and simplifying gives y+r=2b. Combining with the third inequality gives 3r < 2b.
 * So our possibilities for (b, 2b) are (0, 0), (1, 2), (2, 4), (3, 6), (4, 8) or (5, 10). Only (5, 10) contains both a multiple of 2 and a multiple of 3, so b = 5, and r = 3.  Plugging this into the earlier equations gives y = 7 and g = 8.--108.36.85.111 (talk) 16:41, 29 November 2021 (UTC)


 * You can approach such problems more systematically using integer programming techniques. Combining the two equations gives g = b + r. Also, because the values are integers, b + 1 ≤ g, y + 1 ≤ g, 2r + 1 ≤ y. This gives
 * 0=−b+g−r
 * 0=−3b+g+y
 * 1=−b+g−s1
 * 1=g−y-s2
 * 1=y−2r-s3
 * where all variables are ≥0. Solving for b, g, y, r, s1 in terms of s2 and s3 gives
 * b=5+3s2+2s3
 * g=8+5s2+3s3
 * y=7+4s2+3s3
 * r=3+2s2+s3
 * s1=2+2s2+s3
 * This gives all non-negative integers solutions as s2 and s3 range over the non-negative integers. (The magic is deciding which variables to solve for. There are 7 choose 2 = 21 possibilities but the simplex algorithm can be used to avoid trial and error.) From the second equation it's clear that the only solution with g<10 has s2 = s3 = 0, making the only solution b=5, g=8, y=7, r=3. --RDBury (talk) 22:23, 29 November 2021 (UTC)
 * Thank you very much, RDBury and user at 108.36.85.111. Good insights, in particular that blue <= 5. Cheers, cm&#610;&#671;ee&#9094;&#964;a&#671;&#954; 00:27, 30 November 2021 (UTC)