TITLE: Help understand a connection between probabilities of dice outcomes and number of elements of a hypercube
QUESTION [5 upvotes]: I found a curious connection between probabilities of dice outcomes and number of elements of a hypercube and I can't make sense of it.
I was trying to calculate odds of getting $0,1,..,x$ threes when rolling $x$ (hypothetical) 3-sided dice, i.e. when rolling 5 3-sided dice, what are the odds 2 of them will land on threes etc.
The (AFAICT correct) odds are (for 0,1,2,3,4,5 threes respectively):

1 dice - $2/3$, $1/3$
2 dice - $4/9$, $4/9$, $1/9$
3 dice - $8/27$, $12/27$, $6/27$, $1/27$
4 dice - $16/81$, $32/81$, $24/81$, $8/81$, $1/81$
5 dice - $32/243$, $80/243$, $80/243$, $40/243$, $10/243$, $1/243$

Compare it with number of elements in x-dimentional cube (from wikipedia):

1-cube - 2 vertices, 1 edge
2-cube - 4 vertices, 4 edges, 1 face
3-cube - 8 vertices, 12 edges, 6 faces, 1 cell
4-cube - 16 vertices, 32 edges, 24 faces, 8 cells, 1 4-face
5-cube - 32 vertices, 80 edges, 80 faces, 40 cells, 10 4-faces, 1 5-face

This continues as least to 10 dice/dimensions. Same thing happens with 2-side dice (aka coins) and hyper-tetrahedron.
Why do probabilities of rolling a certain dice face $y$ number of times on $x$ dice would match a number of elements of a $x$-dimentional shape like that?

REPLY [2 votes]: Actually the connection is very strong: it's an isomorphism.
The outcome of the roll of $n$ $r$-faced dice is a $n$-tuple, with components value
ranging from $1$ to $r$, which also define a $n$-(hyper)cube, with sides
$1, \cdots, r$.
Then an outcome = point $(r,r,x,\cdots,x)$, for instance, is a face of dimension $n-2$, etc.
This of course means that you "label" each of the $n$ dice, and in the same way you consider the order in the results.
See also this post.
for some further applications.