Determining a hidden digit

[I got this problem from Olean Brown, who had pointed me to the following web page that claims to read your mind.]

Think of a positive integer, call it X. Shuffle the decimal digits of X, call the resulting number Y. Subtract the smaller of X,Y from the larger, call the difference D. D has the following property: Any non-zero decimal digit of D can be determined from the remaining digits. That is, if you ask someone to hide any one of the non-zero digits in the decimal representation of D, then you can try to impress the other person by figuring out the hidden digit from the remaining digits. How is this done? Why does it work?

©2020-2023 K.R.M. Leino - Split Template by One Page Love