For those interest in the 1st question, the trick is mental math, involving possibilities which is to say:
- Hypothetically, her mother is from 20-100. So maximum age she can reach is 100 which mean Ruka age x 4 is always smaller than 100 and larger than 20, so Ruka age is from 20/4 - 100/4 = 5 - 25 => 21 possibility of Ruka age.
- Ruka + 4 = 1 third of her mother age + 4. so mental count here, 5 20 pair will turn 9 and 24, 6 24 turn into 10 28. so just check it until you find a pair that is managed to multiply by 3 from low count. There is actually another method of prime number checking to avoid those can't multiply by 3 but i don't know how to do this. But in general this is the brute force method.
Note that this is only work because the maximum cap is 100 and the lower cap is 20, which mean there are only 21 possibilities and Ruka age count is only by 1 so 9,10,11 to 29. while Ruka mother is a litlle bit harder, 24, 28, 32, 36 good enough at mental count can pass this easily. if the cap is higher then this won't work. This is Nasa method. In this case, Nasa only need to mental count 4 pair and he got results.
The correct method is set Ruka and mother age as paralleled equation: basically , (Ruka+4) x 3 = mother +4 and Ruka x 4 = mother in which Ruka = mother/4 and we would get something like (mother/4+4)x3= mother +4
Most of the time, people will use the lower method, but if you practiced mental math or learning possibilities before then you can do the 1st method, generally kid gone to young mental math class can do the 1st method as well, not as fast as Nasa though. You see this kind of techniques in whiz kid gameshow or intelligence contest gameshow. When the cap is not that high, brute force tend to be faster. Of course, doing it while making a database is beyond probably most human though