A three dice roll question I got this question from an interview.
A and B are playing a game of dice as follows. A throws two dice and B throws a single die. A wins if the maximum of the two numbers is greater than the throw of B. What is the probability for A to win the game?
My solution.
If $(X,Y)$ are the two random throws of A and $Z$ is the random throw of B, then the problem asks (if I guessed correctly) to compute $P(\max(X,Y)>Z)$. But how to do it? I highly appreciate your help.

Let's first code up a simulation to see where we should head, and then let's come at this theoretically. In R...
sims <- replicate(1000000, {
  
  A <- max(sample(1:6, replace=T, size=2))
  B <- sample(1:6, size=1)
  
  ifelse(A>B, 'A WINS', 'B WINS')
})

prop.table(table(sims))
sims
  A WINS   B WINS 
0.578675 0.421325 

We can be confident in these results up to the second decimal place, so A wins about 57% of the time.  For an interview, I think this is a sufficiently good answer. Let's analyze
Let $B$ be the roll form player B and let  $A = \max(A_1, A_2)$ be the number rolled for player A which, which is the maximum of the two rolls.  Luckily, we don't have to do any math to get the distribution of $A$, we can just do some logcial thinking.
$A=1$ when both $(A_1 = 1, A_2=1)$.  So out of a possible 36 outcomes, $A=1$ can only happen 1 way.  So $P(A=1)=1/36$.  Similarly, $A=1$ when either $(A_1=1, A_2)=2$ or $(A_1=2, A_2=1)$ or $(A_1=2, A_2=2)$.  That's 3 outcomes out of 36 so $P(A=2) = 3/36$.  We can continue on like this to get the entire distribution.  Using R for some help...
library(tidyverse)

crossing(
  A1 = 1:6,
  A2 = 1:6
) %>% 
  mutate(A = pmax(A1, A2)) %>% 
  count(A)

# A tibble: 6 × 3
      A     n      p
  <int> <int>  <dbl>
1     1     1 0.0278
2     2     3 0.0833
3     3     5 0.139 
4     4     7 0.194 
5     5     9 0.25  
6     6    11 0.306 

Do you think you can take it from here?

 To compute $P(A>B)$ we need to know the joint distribution of $(A=a, B=b)$. Because the two random variables are independent, $P(A=a, B=b) = P(A=a)P(B=b)$. A can only win when their roll exceeds $B$ so we need to compute $P(\text{A Wins}) = \sum_{b=1}^{b=5} \sum_{a=b+1}^{6} P(A=a, B=b)$.  The sum turns out to be approximately 0.579, so $P(\text{A Wins}) = 57.9\%$.  If you wanted this as an exact answer, simply do the arithmetic.

