Students helping students, join us in improving Bored of Studies by donating and supporting future students!
Code:The puzzle is based on 2 provable facts: 1. An integer is divisible by 9 IFF the sum of its digits is divisible by 9. 2. If you take any 2 permutations of the same set of digits, and subtract one from the other, the result is always divisible by 9. Given these facts, the puzzle operation is simple. After subtraction you have a number divisible by 9. You tell me all the digits except 1. I add them up in modulo 9, giving X, where X is a digit 0..9. The missing digit D is given by 9 - X. If I get X = 3, the missing digit must be a 6. You are asked not to omit a zero, because I can't tell then whether you omitted a 0 or a 9. Proofs: 1. Divisibility by 9 Any integer M is a sum of terms a(n) * 10^n, n = 0, 1, 2 .... where each a(n) is a digit 0..9 So we write M = Sum[ a(n) * 10^n ] (for each n = 0, 1 , 2, etc) So, M mod 9 = Sum[ (a(n) * 10^n) mod 9 ] But 10^n mod 9 = 1 for any n, so M mod 9 = Sum[ a(n) mod 9 ] = Sum[ a(n) ] mod 9 QED 2. Subtraction of any 2 permutations of an integer is divisible by 9 Given M as defined above, if M2 is a permutation of M, then M2 = Sum[ a(n) * 10^m(n) ] (for each n = 0, 1 , 2, etc) Notice I've just changed the power of 10, each m(n) is also 0, 1, 2 etc but in some other order. Example: 4321 = 1 + 2x10 + 3x100 + 4x1000 2134 1x100 + 2x1000 + 3x10 + 4 Subtraction gives (M - M2) mod 9 = Sum[ a(n) * (10^n - 10^m(n)) ] mod 9 But we know ANY power of 10 = 1 mod 9, so = Sum[ a(n) * (1 - 1) ] mod 9 = 0 mod 9 QED
Heheh something like that.Originally posted by redslert
having maths withdraw ND?![]()
Well it's not NECESSARY to figure it out. With my proof, you could just assume that 10^n - 1 = 9B where B is an integer. It's pretty obvious 10^n - 1 = 9999...999 To n-1 places.Originally posted by ND
No wonder i couldn't figure it out; i don't know any modular arithmetic. Thanks.
To be honest, i didn't even really read through the proofs, i just saw "mod 9" and thought "ugh, modular arithmetic". I gotta learn me that someday... (i've never done anything outside of 4u, and that includes most yr7-10 work too)Originally posted by KeypadSDM
Well it's not NECESSARY to figure it out. With my proof, you could just assume that 10^n - 1 = 9B where B is an integer. It's pretty obvious 10^n - 1 = 9999...999 To n-1 places.
But i thought that 133 was higher than 135? or is modular arithmetic too easy for 133? (i remember spice girl saying he learned it in yr7)ND, no modular arithmatic for first year Actuarials unless you do 135, btw.