# Ask the Wizard #89

"Anonymous" .

Often these mind reading number puzzles work because an interesting mathematical oddity. If the sum of digits of a number is divisible by 9 then the number it self is divisible by 9. Let’s try it on the phone number of the Las Vegas Tropicana (702-739-2222). The sum of digit is 7+0+2+7+3+9+2+2+2+2 = 36. 36 divides evenly by 9, so 702739222 must also be divisible by 9. Here is a proof of this.

- Let n bet any integer. Express n as d
_{0}*1 + d_{1}*10 + d_{2}*100+ d_{3}*1000+ ... + d_{n}*10^{n}, where d_{n}is the first digit, d_{n-1}is the second, and so on. - n = [d
_{0}+ d_{1}+ d_{2}+ ... + d_{n }] + [d_{1}*9 + d_{2}*99+ d_{3}*999+ ...+ d_{n}*999...9 ( a number with n nines)] - n = [d
_{0}+ d_{1}+ d_{2}+ ... + d_{n }] + 9*[d_{1}*1 + d_{2}*11+ d_{3}*111+ ... d_{n}*111...1 (a number with n ones)] - 9*any integer is evenly divisible by 9. So if d
_{0}+ d_{2}+ d_{2}+ ... + d_{n }, or the sum of digits, is divisible by 9, then the entire number must be divisible by 9.

Now that we have that proof out of the way we can look at this magic trick. The problem asks you to pick any number. Then rearrange the digits to make a second number. Then subtract the smaller number from the larger number.

The answer is always going to have a sum of digits divisible by 9. Why? For every digit in the original number it appears somewhere else in the other number. Going one set of digits at a time, changing all the other numbers to zero, we could boil down each set as +/- n*[10^{x} - 10^{y}] (where x>=y and n is the digit) = +/-n *10^{y} * (10^{x-y} - 1) = 10^{y} * (a number composed of only nines) = a number divisible by 9.

Let’s look at an example. Let the original number be 1965. Scramble it up to get 6951. 6951 - 1965 = 6*(1000-10) + 9*(100-100) + 5*(10-1) + 1*(1-1000) = 6*990 + 9*0 + 5*9 + 6*-999. Note that each part is divisible by 9, thus the number you get after subtracting must also be divisible by 9, and finally the sum of digits is also divisible by 9.

The trick then asks you to circle a number except 0 and enter the sum of all the other digits. The program then only needs to add a number to the number you entered so that the sum is divisible by 9. For example if you said the sum of your digits was 13 then you must have circled a 5, because 13+5 = a number divisible by 9.

The reason you can’t circle a zero is because if you did and then entered a number already divisible by 9 then the program wouldn’t know whether you circled a 0 or a 9.

*"For those who sometimes lose too much and later regret their actions some self-constraints may be in order. I would suggest setting a specific loss point in these cases, for example $200. Personally I don’t set such limits on myself. If I’ve lost too much it won’t be fun any more and I’ll step away for that reason."*

But for you, what does "too much" mean? On every other web page of your wonderful site, you warn against using gut feelings. But when it comes to losing, you say you stop when it doesn’t feel good. Especially with video poker, I set a bankroll size, and I stop when I lose that. Losing always sucks, whether it’s 1 credit or 300 credits.

"Anonymous" .

You are right that I am not specific about money management. Unlike other gambling writers I do not put a lot of emphasis on how much to bet or when to walk away. For the recreational gambler there is no method of money management that can either add to or take from the house edge over the long run, so why dwell on it? So while I’m very specific on how to play your cards how much to bet is up to you. There should be some room for free will in gambling anyway. However I do say that if you’ve lost so much that gambling isn’t for fun any more then it is time to walk away.

"Anonymous" .

The expected number of ones is 30*(1/6) = 5. The probability of exactly 5 ones is combin(30,5)*(1/6)^{5}*(5/6)^{25} = 19.21%.

"Anonymous" .

In a cut card game the answer is no. However in a game where the dealer dealt exactly x hands every shoe the answer would be yes. The reason is hard to explain. For more information please see my blackjack appendix 10.

"Anonymous" .

My webmaster Michael Bluejay is a loyal Mac user and has a helpful page about Macintosh casino games.