Found an interesting maths puzzle (originally in German) for those so inclined and who fancy a small diversion:
https://www.spektrum.de/raetsel/wie-viele-fahrgaeste-sind-im-zug/2071047
Translation: A train is pulling 11 passenger cars. There are 381 passengers total, and in any 3 consecutive cars there are 99 passengers. How many are in the ninth carriage?
(Please use CW to prevent spoilers in the replies so that others can enjoy the puzzle too)
Thanks for a fun puzzle. I haven't much math since finishing university in 2010, so it is good with a refresher
@mattp
Answer is 15. Can be solved with some simple matrix algebra
twist
@tajac @mattp How I solved it too. I initially expected to have to use the underdeterminedness to construct an integer solution from the least squares solution, but got a surprise. Using the backslash operation, my version of Matlab gives another less symmetric solution. However, an explicit pinv(M)*RHS gives your solution.
twist
@imdef @mattp
Well, you have 10 equations to determine 11 variables. That inevitably leaves one degree of freedom up for grabs 🤷♂️ (to be fair, I didn't give it much though at first myself and intuitively expected the same)