In a well shuffled deck of cards what is the expected number
In a well shuffled deck of cards, what is the expected number of spades between the ace of diamonds and the king of hearts?Also , find the varience of the random variable.
Solution
There are 52x51 possible situations. The Ace of Diamonds can be in 1 of 52 positions, and for each of those, the King of Hearts can be in 51. 52x51 = 2652.
 
 Therefore the placement of that Ace and King gives you 2652 equally possible situations, and the expected number of spaces in each situation is the number of intervening cards X 13/50 (= number of spades among the intervening cards).
set up a 52x52 array for the position of each of those 2 cards, and calculated the number of cards between them. The cards can\'t be in the same place, so if the positions are equal, it\'s 0, and that will be ignored. If they aren\'t 0, the number of cards in between is abs(position1 - position2) -1. Add those all up and you get 44200. For each possibility, the expected number of spades is the number of cards X 13/50. 44200 / 2652 X (13/50) = 4.3333 is E(X).
V(x) =E(x2) - (E(x))2
V(x) = 1127100 X (13/50)^2 / 2652 - (4.33)2
V(x) =11.560

