A school is running a raffle for two prizes. 5 9 tickets were sold for the raffle, numbered 1 , … , 5 9 . All the tickets are put into a hat and a teacher picks out two tickets which have numbers i and j from the hat. What is the expected value of ∣ i − j ∣ ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
The expected value is defined as
E(x)= i ∑ x i P(x)
where x is the value of the random variable and P(X) is its probability function.
There is only 1 combination that will result to a difference of 58, that is 1 and 59. We are tasked to get the expected value of the absolute value of the difference of the two numbers so we will use combination since the order does not matter
There are 2 combinations that result to a 57 (59 and 2, 58 and 1). Three combinations to get 56 (59 and 3, 58 and 2, 57 and 1) and so on.
We can write the expected value as: i = 1 ∑ 5 8 ( 5 9 − i ) ( 2 5 8 ) i
Rewriting, we have ( 2 5 8 ) 1 ∗ ( 5 9 ∗ i = 1 ∑ 5 8 i − i = 1 ∑ 5 8 i 2 )
i = 1 ∑ n i = 2 n ( n + 1 ) and i = 1 ∑ n i 2 = 6 n ( n + 1 ) ( 2 n + 1 )
Substituting, we have, ( 2 5 9 ∗ 5 8 1 ) ∗ ( 5 9 ∗ 2 5 8 ∗ 5 9 − 6 5 8 ∗ 5 9 ∗ 1 1 7 )
Simplifying, we get 20.
The expected value refers to the weighted mean of all the possible values that ∣ i − j ∣ can take on.
From the question, it can be seen that the maximum difference between the two raffle numbers is 5 9 − 1 = 5 8 , which can only be obtained in 1 way (by drawing ticket 1 and 59). If ∣ i − j ∣ = 5 8 , then there can be only 2 ways of obtaining such a difference (by drawing ticket 1 & 58 and 2 & 59) and so on. Also, ∣ i − j ∣ = 0 since the two tickets were drawn one after another without putting any ticket back.
Generally, if ∣ i − j ∣ = n , then the number of possible ways to obtain n is 5 9 − n . Thus, 1 ≤ n ≤ 5 8 .
To calculate the expected value of ∣ i − j ∣ , simply take the summation of the products of all the possible values of ∣ i − j ∣ = n and their respective probabilities, represented by 5 9 × 5 8 5 9 − n . In short, the expected value is given by the summation,
2 ⋅ n = 1 ∑ 5 8 n ( 3 4 2 2 5 9 − n )
Note: Since ∣ i − j ∣ is the absolute difference between the two raffle numbers, there are two ways to draw any pair of raffle numbers, hence, all the probabilities are doubled and the whole summation is multiplied by 2.
Simplifying the summation:
2 ⋅ n = 1 ∑ 5 8 n ( 3 4 2 2 5 9 − n )
= 3 4 2 2 2 ⋅ n = 1 ∑ 5 8 n ( 5 9 − n )
= 1 7 1 1 1 ⋅ n = 1 ∑ 5 8 ( 5 9 n − n 2 )
= 1 7 1 1 1 ( 5 9 ⋅ n = 1 ∑ 5 8 n − n = 1 ∑ 5 8 n 2 )
= 1 7 1 1 1 ( 5 9 ⋅ 2 5 8 × ( 5 8 + 1 ) − 6 ( 5 8 ) ( 5 8 + 1 ) ( 2 ( 5 8 ) + 1 ) )
= 1 7 1 1 1 ( 1 0 0 9 4 9 − 6 6 7 2 9 )
= 1 7 1 1 1 ( 3 4 2 2 0 )
= 2 0
Let E ( n ) be the expected value of ∣ i − j ∣ when there are n tickets in the hat (from 1 to n ), n ≥ 2 . Since ∣ i − j ∣ = ∣ j − i ∣ , the order of choice of the tickets is unimportant. Since there is equal probability of choosing any (unordered) pair { i , j } of tickets from the set S ( n ) = { { i , j } ∣ i , j ∈ { 1 , . . . , n } , i = j } of ( 2 n ) possible pairs, we have E ( n + 1 ) = { i , j } ∈ S ( n + 1 ) ∑ ( 2 n + 1 ) ∣ i − j ∣ = { i , j } ∈ S ( n ) ∑ ( 2 n + 1 ) ∣ i − j ∣ + i = 1 ∑ n ( 2 n + 1 ) ∣ ( n + 1 ) − i ∣ = ( 2 n + 1 ) ( 2 n ) { i , j } ∈ S ( n ) ∑ ( 2 n ) ∣ i − j ∣ + ( 2 n + 1 ) 1 i = 1 ∑ n i = n + 1 n − 1 E ( n ) + 1 Since of course E ( 2 ) = ∣ 1 − 2 ∣ = 1 , it's easy to see by induction that E ( n ) = 3 n + 1 : it holds for n = 2 ; and if it holds for n , we have E ( n + 1 ) = n + 1 n − 1 E ( n ) + 1 = n + 1 n − 1 3 n + 1 + 1 = 3 n − 1 + 1 = 3 ( n + 1 ) + 1 . Therefore E ( 5 9 ) = 6 0 / 3 = 2 0 .
Given number 1, .... n. Because two numbers are picked at once, we may conclude that the numbers are a pair of different numbers. Let i and j be the numbers picked with i has greater value than j. The expected value of |i - j| can be found with assumptions i become expected value of the greatest number and j become expected value of the lowest number.
(1) There are i - 1 ways for i to be the greatest number, also there are ½n(n - 1) ways to pick two numbers. By using the formula for expected value,
∑ (n, i = 2) {i(i - 1)}/{½n(n - 1)} = (2/3)(n + 1)
(2) There are n - j ways for j to be the lowest number, also there are ½n(n - 1) ways to pick two numbers. By using the formula for expected value,
∑ (n, j = 2) {j(n - j)}/{½n(n - 1)} = (1/3)(n + 1)
|i - j|
= |(2/3)(n + 1) - (1/3)(n + 1)|
= |(1/3)(n + 1)|
By substituting n = 59,
|i - j| = 20
Let X be the random variable that represents the difference k : = ∣ i − j ∣ . k ∈ { 1 , . . . , 5 8 } . Since the possible difference k can be obtained 5 9 − k ways, we have that P ( X = k ) = 5 9 ⋅ 5 8 2 ⋅ ( 5 9 − k ) .
E ( X ) = k = 1 ∑ 5 8 k ⋅ P ( X = k ) = k = 1 ∑ 5 8 5 9 ⋅ 5 8 k ⋅ 2 ⋅ ( 5 9 − k ) = 5 9 ⋅ 5 8 2 k = 1 ∑ 5 8 5 9 k − k 2 .
Using the formulas i = 1 ∑ n i = 2 n ( n + 1 ) and i = 1 ∑ n i 2 = 6 n ( n + 1 ) ( 2 n + 1 ) , we find that 5 9 ⋅ 5 8 2 k = 1 ∑ 5 8 5 9 k − k 2 = 5 9 ⋅ 5 8 2 ⋅ [ 2 ( 5 9 ) ( 5 8 ) ( 5 9 ) − 6 ( 5 8 ) ( 5 9 ) ( 1 1 7 ) ] .
Distributing 5 9 ⋅ 5 8 2 through yields 5 9 − 3 9 = 2 0 .
\frac {(1 \times 58 + 2 \times 57 + ... + 57 \times 2 + 58 \times 1)} {C^59_2}
= \frac {\sum_{i=1}^58 i \times (59 - i)} {\frac {59 \times 58} {2}}
= \frac {\sum {i=1}^58 59i - \sum {i=1}^58 i^2} {\frac {59 \times 58} {2}}
=\frac {59 \times \frac {1} {2} \times 58 \times (58 + 1) - \frac {1} {6} \times 58 \times (58 + 1) \times (2 \times 58 + 1)}{\frac {59 \times 58} {2}}
= 59 - \frac {117} {3}
= 20
The expected value (expectancy function) is given by the sum xP(x), x from 0 to infinity,where P(x) is the probabilty to x occurs. So we have to evaluate the sum k [2(59-k)/(59x58)], k from 1 to 58. Because1<=|i-j|<=58. We have 2 (59-k) cases where the difference is k, and 59x58 total cases. Calculating the sum.. we can break it into two sums: 1/58x59[118 sum(k)-2 sum(k^2)]=1/58x59[118 (58 (58+1)/2)-2 (2 58+1) 58 (58+1)/6] =20 because sum(k^2)= (2n+1)n(n+1)/6 and sum (k) is a sum of a A.P.
There are in total ( 2 5 9 ) pairs of numbers that they could choose. There are 58 pairs of integers with difference of 1, 57 pair of difference of 2, and so on. So the total sum of all pair of differences is : n = 1 ∑ 5 8 n ∗ ( 5 9 − n ) . So to calculate expected value, we divide it by ( 2 5 9 ) to get
2 5 9 × 5 8 2 5 9 × 5 8 × 5 9 − 3 5 8 × 5 9 × 1 1 7 = 5 9 − 3 1 1 7 = 2 0 .
[Corrected errors - Calvin]
Solution 1: There are in total ( 2 5 9 ) pairs of numbers that they could choose. There are 58 pairs of integers with difference of 1, 57 pair of difference of 2, and so on. So the total sum of all pair of differences is : n = 1 ∑ 5 8 n ⋅ ( 5 9 − n ) . So to calculate expected value, we divide it by ( 2 5 9 ) to get 20.
Solution 2: Suppose the first ticket picked is i and the second picked is j and let n = 5 9 . When the first ticket picked is i , the expected value of ∣ i − j ∣ is
= = = ( ∑ k = 1 i − 1 ( i − k ) + ∑ k = i + 1 n ( k − i ) ) / ( n − 1 ) 2 ( n − 1 ) i ( i − 1 ) + 2 ( n − 1 ) ( n − i ) ( n − i + 1 ) 2 ( n − 1 ) i 2 − i + n 2 − 2 i n + i 2 + n − i 2 ( n − 1 ) 2 i 2 + ( − 2 n − 2 ) i + n 2 + n
To find the overall expectation, we sum this over all i and divide by n .
= = = = = = ∑ i = 1 n 2 n ( n − 1 ) 2 i 2 + ( − 2 n − 2 ) i + n 2 + n 1 2 n ( n − 1 ) 2 n ( n + 1 ) ( 2 n + 1 ) − 4 n ( n − 1 ) 2 n ( n + 1 ) 2 + 2 n ( n − 1 ) n 2 ( 1 + n ) 6 ( n − 1 ) ( n + 1 ) ( 2 n + 1 ) − 6 ( n − 1 ) 3 ( n + 1 ) ( n + 1 ) + 6 ( n − 1 ) 3 n ( n + 1 ) 6 ( n − 1 ) ( n + 1 ) ( 2 n + 1 − 3 n − 3 + 3 n ) 6 ( n − 1 ) ( n + 1 ) ( 2 n − 2 ) 3 n + 1 2 0
We could have also used symmetry to assume that i < j and only sum these pairs.
Two numbers between 1-59 would be 20 and 40 on average. 40-20=20 is the answer.
Let's calculate the expected value by its definition. 1) when |i−j|= 1 : probability of this case is 58/(59*58/2) (because we have (i,j)=(1,2), (2,3),(3,4) .... (58,59), and the total case is to choose )
The expected is $E=2.1.\frac{58}{2.C {59}^{2}} + 2.2.\frac{57}{2.C {59}^{2}}+ 2.3.\frac{56}{2.C{59}^{2}}+...+2.58.\frac{1}{2.C_{59}^2}} =20$ so my result is 20
There are ( 2 5 9 ) ways to pick up two numbers (unordered).
Now, if ∣ i − j ∣ = x there are 59-x possible values of ( i , j ) (unordered) x can have value from 1 to 58. So the probability is: ( 2 5 9 ) ∑ x = 1 x = 5 8 x ∗ ( 5 9 − x ) = 2 0
note, \sum_{x=1}^(x=k} { x^2 } = \frac{k*(k+1)*(2k+1)}{6} and \sum_{x=1}^(x=k} { x } = \frac{k*(k+1)}{2}
Problem Loading...
Note Loading...
Set Loading...
We can quickly see that there is 1 way to have a difference of 5 8 , 2 ways to have a difference of 5 7 , and in general, n ways to have a difference 5 9 − n .
Because we are looking for an expected value, we want to sum all the possible outcomes multiplied by the probability that they happen: that is, we want x ∈ S ∑ X ⋅ P ( x ) , where X is the point value of event x , P ( x ) is the probability of event x happening, and S is the set of all possible outcomes.
In the case of this problem, we want n = 1 ∑ 5 8 ( 2 5 9 ) n ⋅ ( 5 9 − n ) , because as noted above, there are n ways for an event with point value 5 9 − n to happen out of a total of ( 2 5 9 ) possible choices of i and j (note that order doesn't matter, as we want the ∣ i − j ∣ . In order to calculate this difficult-looking sum quickly, we can use a few shortcuts.
Expanding the summand's numerator, we get 5 9 n − n 2 , so we want ( 2 5 9 ) 5 9 ⋅ n = 1 ∑ 5 8 n − n = 1 ∑ 5 8 n 2 . The first sum is clearly 5 9 ⋅ 2 5 8 ⋅ ( 5 8 + 1 ) = 2 9 ⋅ 5 9 2 since i = 1 ∑ k i = 2 i ⋅ ( i + 1 ) .
The second sum can be greatly simplified using the fact that i = 1 ∑ k i 2 = 6 2 k 3 + 3 k 2 + k . This can be proven through very simple induction and can be derived by using the finite differences method of finding polynomial representations of sequences. With this in mind, we find that the sum is 6 2 ⋅ 5 8 3 + 3 ⋅ 5 8 2 + 5 8 .
Subtracting one sum from the other and dividing by ( 2 5 9 ) = 2 5 9 ⋅ 5 8 yields 5 9 ⋅ 5 8 2 ⋅ 2 9 ⋅ 5 9 2 − 6 ⋅ 5 9 ⋅ 5 8 2 ⋅ ( 2 ⋅ 5 8 3 + 3 ⋅ 5 8 2 + 5 8 ) = 5 9 − 3 ∗ 5 9 2 ⋅ 5 8 2 + 3 ⋅ 5 8 + 1 = 5 9 − 3 ∗ 5 9 5 8 2 + 5 8 + 5 8 2 + 2 ⋅ 5 8 + 1 = 5 9 − 3 ∗ 5 9 5 8 ⋅ ( 5 8 + 1 ) + ( 5 8 + 1 ) 2 = 5 9 − 3 5 8 + 5 9 = 5 9 − 3 9 = 2 0 . Therefore, 2 0 is the expected value for ∣ i − j ∣ .