# 3 Letter Initial Phone Keypad Hash Distribution

I have written a c++ function that generates a 3 digit number corresponding to each letter in a random 3 letter initial and their location on a phone keypad. For Example, my initials MSG, would return 674. I have to compare the results of how many times different initials return the same hash with the mathematical prediction of this, but i am not sure where to begin. Is this a combinatorial problem? where do I begin?

• M,N,O returns 6. P,Q,R,S returns 7 and G,H,I returns 4. Thus there are $3\cdot 4\cdot 3=36$ combinations which returns the sequence $674$. – callculus Jun 9 '17 at 22:33
• @callculus how would i find the total amount of possible outcomes with 512 random 3 letter initials? I need it to find the probability of different initials producing their own unique number sequences, how many times an initial produce the same sequence as 1 other, 2 other, 3 other, and 4 other initials? – EggplantMachina Jun 9 '17 at 23:35

So the number of preimages of $d_1d_2d_3$ equals $3^a4^b$, where $b = |\{i: d_i \in \{7,9\}\}|$, and $a= 3-b$. Every digit not equal to $7$ or $9$ has 3 possible letters leading to it, $7$ and $9$ alone have 4.