Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
The five triplets A,B,C,D,E are such that
and
Given that
find the five triplets.
Adding up both sets of equations shows everything solely depends upon E1… So running an R code that checks for all possible values of E1 is a brute-force solution. However, one must first find what to check. Given that the sums of the triplets are of the form (16s,4s,s), the possible choices for E1 are necessarily restricted to
> S0=193+187+185+175 > ceiling(S0/16) [1] 47 > floor((S0+175)/16) [1] 57 > (47:57)*16-S0 #E1=S1-S0 [1] 12 28 44 60 76 92 108 124 140 156 172
The first two values correspond to a second sum S2 equal to 188 and 192, respectively, which is incompatible with A1 being 193. Furthermore, the corresponding values for E2 and E3 are then given by
> S2==(49:57)*4 > E1=(49:57)*16-S0 > E2=S2-E1 > S3=S2/4 > S3-E2 [1] -103 -90 -77 -64 -51 -38 -25 -12 1
which excludes all values but E1=172. No brute-force in the end…
Filed under: Books, Kids, R Tagged: Le Monde, mathematical puzzle, R, system of equations
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.