Ram draws a card randomly among cards numbered 1-23 and keeps it back. Then Sam draws a card among those left. What is the probability that Sam has drawn a card greater than Ram?
My Approach:
I could not solve this question.
I suppose that you have understood by now that you need not actually use brute force ?
Just by symmetry, Pr = 1/2.
If you can see that symmetry exists in a situation, use it !
There is a one-to-one correspondence between the scenarios in which Sam draws the higher card and those in which Ram draws the higher card--this is given by exchanging the cards each has drawn. In this way we see that the number of ways that Sam draws a higher card is equal to the number of ways that Ram draws a higher card and constitutes exactly half of the possible outcomes (since in each scenario either Sam or Ram has a higher card). It follows that the probability you are looking for is $\frac{1}{2}$. Using this approach you don't need to 'calculate' any probabilities.
If $R$ draws a $1$, then $S$ has a $\dfrac{22}{22}$ probability of winning.
If $R$ draws a $2$, then $S$ has a $\dfrac{21}{22}$ probability of winning.
$\vdots$
If $R$ draws a $23$, then $S$ has a $\dfrac{0}{22}$ probability of winning.
Summing all the probabilities and dividing by the number of events ($23$) gives the probability of $S$ winning as:
$$\dfrac{\dfrac{22\times23}{2}}{22\times23}=\dfrac{1}{2}$$
Another approach: it is clear that drawing first conveys no advantage or disadvantage, as the setup just takes two cards at random and gives one to each player. Since there is no possibility of a draw, the only outcomes are victory for Sam and victory for Ram. By the symmetry we observed, these must have equal probability, so we can conclude that both probabilities are $\frac{1}{2}$.
Brute Force If Ram draws card 1, what are the chances Sam draws higher? What if Ram draws 2? 3? 4? See the pattern?
If Sam keeps his card then there are exactly $23\times 22$ ordered pairs, resulting from the draw. And exactly half of them have the first card greater than the second one, and another half of them have the first card less than the second one.
So the probability of Sam win is equal to the probability of Ram win – and both are $\frac 12$.
The result would be a bit less if you consider returning the card to the pool, because there is a third option: a draw, which is $1/23$ of all $23\times 23$ possible results. Then the probability that Sam's card is greater than that of Ram is $\frac 12 \times \frac {22}{23}$.
There are 3 possibilities in such games:
Because each card only exists once, it cannot be a draw, the probability is 0. Next it's always a very good approach to try to quickly figure out who has a higher chance to win. You can later use this to do a sanity check of the calculated result.
Assuming the chance to draw each card is uniform (big assumption - you can influence humans by making some cards dirtier than others, or marking them with scratches, even if they don't know what the value of the marked card is) drawing second does not give a disadvantage. The game is the same as a neutral judge drawing 2 cards while not revealing them and Ram being allowed to pick which of the 2 card he wants. Therefore neither has a higher chance to win. Because neither has a higher chance to win, and we know the probability of the draw (0), we know that each has a probability of 1/2 to win. At that point we can skip the calculation.
The game becomes more interesting if the probability for each card is different, or even better, if the probability depends on both the card and the player - Sam likes cards with cleaner backs while Ram prefers the dirtier cards. In that case, brute force is the way that's most adaptable.
$p_{Ram} = \sum_{i=1}^n \left( p(i,Sam) \cdot \frac{\sum_{j=i+1}^n p(j,Ram)}{1-p(i,Ram)}\right)$
where $p(i,Sam)$ is the probability of Sam drawing the card with value i. In the simple case $p(x,y)$ is a constant $1/23$. This turns to:
$p_{Ram} = \sum_{i=1}^{23} \left( 1/23 \cdot \frac{\sum_{j=i+1}^{23} 1/23}{22/23}\right) = 1/23 \cdot \sum_{i=1}^{23} \frac{\sum_{j=i+1}^{23} 1}{22} = 1/23 \cdot \sum_{i=1}^{23} \frac{n-i}{22}$
$=1/23 \cdot \sum_{i=0}^{22} \frac{i}{22} = 1/23 \cdot \frac{22(22+1)/2}{22} = 1/2$