Expected Raffle Value

A school is running a raffle for two prizes. 59 59 tickets were sold for the raffle, numbered 1 , , 59 1, \ldots, 59 . All the tickets are put into a hat and a teacher picks out two tickets which have numbers i i and j j from the hat. What is the expected value of i j |i - j| ?


The answer is 20.

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.

14 solutions

We can quickly see that there is 1 1 way to have a difference of 58 58 , 2 2 ways to have a difference of 57 57 , and in general, n n ways to have a difference 59 n 59 - 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 ) \displaystyle \sum_{x \in S} X \cdot P(x) , where X X is the point value of event x x , P ( x ) P(x) is the probability of event x x happening, and S S is the set of all possible outcomes.

In the case of this problem, we want n = 1 58 n ( 59 2 ) ( 59 n ) \displaystyle \sum_{n = 1}^{58} \frac{n}{59 \choose 2} \cdot (59-n) , because as noted above, there are n n ways for an event with point value 59 n 59 - n to happen out of a total of ( 59 2 ) 59 \choose 2 possible choices of i i and j j (note that order doesn't matter, as we want the i j \mid i - j \mid . In order to calculate this difficult-looking sum quickly, we can use a few shortcuts.

Expanding the summand's numerator, we get 59 n n 2 59n - n^2 , so we want 59 n = 1 58 n n = 1 58 n 2 ( 59 2 ) \frac{59 \displaystyle \cdot \sum_{n = 1}^{58} n - \displaystyle \sum_{n = 1}^{58} n^2}{59 \choose 2} . The first sum is clearly 59 58 ( 58 + 1 ) 2 = 29 5 9 2 59 \cdot \displaystyle \frac{58 \cdot (58 + 1)}{2} = 29 \cdot 59^2 since i = 1 k i = i ( i + 1 ) 2 \displaystyle \sum_{i = 1}^k i = \frac{i \cdot (i + 1)}{2} .

The second sum can be greatly simplified using the fact that i = 1 k i 2 = 2 k 3 + 3 k 2 + k 6 \displaystyle \sum_{i = 1}^k i^2 = \frac{2k^3 + 3k^2 + k}{6} . 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 2 5 8 3 + 3 5 8 2 + 58 6 \displaystyle \frac{2 \cdot 58^3 + 3 \cdot 58^2 + 58}{6} .

Subtracting one sum from the other and dividing by ( 59 2 ) 59 \choose 2 = 59 58 2 = \displaystyle \frac{59 \cdot 58}{2} yields 2 29 5 9 2 59 58 2 ( 2 5 8 3 + 3 5 8 2 + 58 ) 6 59 58 = \displaystyle \frac{2 \cdot 29 \cdot 59^2}{59 \cdot 58} - \frac{2 \cdot (2 \cdot 58^3 + 3 \cdot 58^2 + 58)}{6 \cdot 59 \cdot 58} = 59 2 5 8 2 + 3 58 + 1 3 59 = \displaystyle 59 - \frac{2 \cdot 58^2 + 3 \cdot 58 + 1}{3 * 59} = 59 5 8 2 + 58 + 5 8 2 + 2 58 + 1 3 59 = \displaystyle 59 - \frac{58^2 + 58 + 58^2 + 2 \cdot 58 + 1}{3*59} = 59 58 ( 58 + 1 ) + ( 58 + 1 ) 2 3 59 = \displaystyle 59 - \frac{58 \cdot (58 + 1) + (58 + 1)^2}{3*59} = 59 58 + 59 3 = \displaystyle 59 - \frac{58 + 59}{3} = 59 39 = 20 59 - 39 = 20 . Therefore, 20 20 is the expected value for i j \mid i - j \mid .

Nice solution, well explained.

Calvin Lin Staff - 7 years ago

The expected value is defined as

E(x)= i x i \displaystyle \sum_{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 58 ( 59 i ) i ( 58 2 ) \displaystyle \sum_{i=1}^{58}(59-i)\frac {i}{58 \choose 2}

Rewriting, we have 1 ( 58 2 ) ( 59 i = 1 58 i i = 1 58 i 2 \frac {1}{58 \choose 2}*(59*\displaystyle \sum_{i=1}^{58}i-\displaystyle \sum_{i=1}^{58}i^2 )

i = 1 n i \displaystyle \sum_{i=1}^{n}i = n ( n + 1 ) 2 \frac {n(n+1)}{2} and i = 1 n i 2 \displaystyle \sum_{i=1}^{n}i^2 = n ( n + 1 ) ( 2 n + 1 ) 6 \frac {n(n+1)(2n+1)}{6}

Substituting, we have, ( 1 59 58 2 ) ( 59 58 59 2 58 59 117 6 ) (\frac{1}{\frac {59*58}{2}})*(59*\frac {58*59}{2} - \frac {58*59*117}{6})

Simplifying, we get 20.

Ryan Phua
May 20, 2014

The expected value refers to the weighted mean of all the possible values that i j |i-j| can take on.

From the question, it can be seen that the maximum difference between the two raffle numbers is 59 1 = 58 59-1=58 , which can only be obtained in 1 way (by drawing ticket 1 and 59). If i j = 58 |i-j|=58 , 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 |i-j|\neq 0 since the two tickets were drawn one after another without putting any ticket back.

Generally, if i j = n |i-j|=n , then the number of possible ways to obtain n n is 59 n 59-n . Thus, 1 n 58 1 \leq {n} \leq 58 .

To calculate the expected value of i j |i-j| , simply take the summation of the products of all the possible values of i j = n |i-j|=n and their respective probabilities, represented by 59 n 59 × 58 \frac {59-n}{59\times 58} . In short, the expected value is given by the summation,

2 n = 1 58 n ( 59 n 3422 ) 2 \cdot {\displaystyle \sum_{n=1}^{58}n(\frac {59-n}{3422})}

Note: Since i j |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 58 n ( 59 n 3422 ) 2 \cdot {\displaystyle \sum_{n=1}^{58}n(\frac {59-n}{3422})}

= 2 3422 n = 1 58 n ( 59 n ) =\frac {2}{3422} \cdot {\displaystyle \sum_{n=1}^{58}n(59-n)}

= 1 1711 n = 1 58 ( 59 n n 2 ) =\frac {1}{1711} \cdot {\displaystyle \sum_{n=1}^{58}(59n-n^2)}

= 1 1711 ( 59 n = 1 58 n n = 1 58 n 2 ) =\frac {1}{1711}({59} \cdot {\displaystyle \sum_{n=1}^{58}n} - \displaystyle \sum_{n=1}^{58}{n^2})

= 1 1711 ( 59 58 × ( 58 + 1 ) 2 ( 58 ) ( 58 + 1 ) ( 2 ( 58 ) + 1 ) 6 ) =\frac {1}{1711}({59} \cdot {\frac {{58} \times (58+1)}{2} - {\frac {(58)(58 + 1)(2(58) + 1)}{6}}})

= 1 1711 ( 100949 66729 ) =\frac {1}{1711}({100949} - {66729})

= 1 1711 ( 34220 ) =\frac {1}{1711}({34220})

= 20 ={20}

Sílvia Cavadas
May 20, 2014

Let E ( n ) E(n) be the expected value of i j |i-j| when there are n n tickets in the hat (from 1 1 to n n ), n 2 n \geq 2 . Since i j = j i |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 } \{i,j\} of tickets from the set S ( n ) = { { i , j } i , j { 1 , . . . , n } , i j } S(n) =\{\{i,j\}|i,j \in \{1,...,n\}, i\neq j \} of ( n 2 ) {n \choose 2 } possible pairs, we have E ( n + 1 ) = { i , j } S ( n + 1 ) i j ( n + 1 2 ) = { i , j } S ( n ) i j ( n + 1 2 ) + i = 1 n ( n + 1 ) i ( n + 1 2 ) = ( n 2 ) ( n + 1 2 ) { i , j } S ( n ) i j ( n 2 ) + 1 ( n + 1 2 ) i = 1 n i = n 1 n + 1 E ( n ) + 1 \displaystyle E(n+1)=\sum_{\{i,j\} \in S(n+1)} \frac{|i-j|}{ {n+1 \choose 2 }}\\ \displaystyle =\sum_{\{i,j\} \in S(n)} \frac{|i-j|}{ {n+1 \choose 2}}+\sum_{i=1}^n \frac{|(n+1)-i|}{ {n+1 \choose 2 }}\\ \displaystyle =\frac{{n \choose 2}}{{n+1 \choose 2}} \sum_{\{i,j\} \in S(n)} \frac{|i-j|}{ {n \choose 2}}+\frac{1}{ {n+1 \choose 2 }} \sum_{i=1}^n i =\frac{n-1}{n+1} E(n)+1 Since of course E ( 2 ) = 1 2 = 1 E(2)=|1-2|=1 , it's easy to see by induction that E ( n ) = n + 1 3 E(n)=\frac{n+1}{3} : it holds for n = 2 n=2 ; and if it holds for n n , we have E ( n + 1 ) = n 1 n + 1 E ( n ) + 1 = n 1 n + 1 n + 1 3 + 1 = n 1 3 + 1 = ( n + 1 ) + 1 3 E(n+1)=\frac{n-1}{n+1} E(n)+1=\frac{n-1}{n+1} \frac{n+1}{3}+1=\frac{n-1}{3}+1=\frac{(n+1)+1}{3} . Therefore E ( 59 ) = 60 / 3 = 20 E(59)=60/3=20 .

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

Andrew Ellinor
May 20, 2014

Let X be the random variable that represents the difference k : = i j k := |i - j| . k { 1 , . . . , 58 } k \in \{1, ..., 58\} . Since the possible difference k k can be obtained 59 k 59 - k ways, we have that P ( X = k ) = 2 ( 59 k ) 59 58 P(X = k) = \frac{2 \cdot (59 - k)}{59 \cdot 58} .

E ( X ) = k = 1 58 k P ( X = k ) = k = 1 58 k 2 ( 59 k ) 59 58 = 2 59 58 k = 1 58 59 k k 2 E(X) = \displaystyle \sum_{k = 1}^{58} k \cdot P(X = k) = \displaystyle \sum_{k = 1}^{58} \frac{k \cdot 2 \cdot (59 - k)}{59 \cdot 58} = \frac{2}{59 \cdot 58} \displaystyle \sum_{k = 1}^{58} 59k - k^2 .

Using the formulas i = 1 n i = n ( n + 1 ) 2 \displaystyle \sum_{i = 1}^n i = \frac{n(n+1)}{2} and i = 1 n i 2 = n ( n + 1 ) ( 2 n + 1 ) 6 \displaystyle \sum_{i = 1}^n i^2 = \frac{n(n+1)(2n + 1)}{6} , we find that 2 59 58 k = 1 58 59 k k 2 = 2 59 58 [ ( 59 ) ( 58 ) ( 59 ) 2 ( 58 ) ( 59 ) ( 117 ) 6 ] \displaystyle \frac{2}{59 \cdot 58} \displaystyle \sum_{k = 1}^{58} 59k - k^2 = \frac{2}{59 \cdot 58} \cdot [ \frac{(59)(58)(59)}{2} - \frac{(58)(59)(117)}{6}] .

Distributing 2 59 58 \frac{2}{59 \cdot 58} through yields 59 39 = 20 59 - 39 = 20 .

\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

Correct, but lacks any words explaining what they are doing.

Calvin Lin Staff - 7 years ago
Bruno Lerner
May 20, 2014

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.

Needs better explanation.

Calvin Lin Staff - 7 years ago
Shuai He
May 20, 2014

There are in total ( 59 2 ) {59 \choose 2} 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 58 n ( 59 n ) \displaystyle \sum_{n=1}^{58} n*(59-n) . So to calculate expected value, we divide it by ( 59 2 ) {59 \choose 2} to get

59 × 58 × 59 2 58 × 59 × 117 3 59 × 58 2 = 59 117 3 = 20. \frac { \frac {59 \times 58 \times 59}{2} - \frac {58 \times 59 \times 117} {3} } {\frac {59 \times 58} {2} } = 59 - \frac {117}{3} = 20.

[Corrected errors - Calvin]

What would the general solution be, if there are R R number of raffle tickets?

Calvin Lin Staff - 7 years ago
Calvin Lin Staff
May 13, 2014

Solution 1: There are in total ( 59 2 ) {59 \choose 2} 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 58 n ( 59 n ) \displaystyle \sum_{n=1}^{58} n\cdot (59-n) . So to calculate expected value, we divide it by ( 59 2 ) {59 \choose 2} to get 20.

Solution 2: Suppose the first ticket picked is i i and the second picked is j j and let n = 59 n = 59 . When the first ticket picked is i i , the expected value of i j |i - j| is

( k = 1 i 1 ( i k ) + k = i + 1 n ( k i ) ) / ( 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 2 ( n 1 ) \begin{array} {l l} & & \left(\sum_{k = 1}^{i-1} (i -k) + \sum_{k=i+1}^{n} (k - i) \right) /(n-1)\\ & = &\frac{i(i-1)}{2(n-1)} + \frac{(n-i)(n-i+1)}{2(n-1)}\\ & = & \frac{i^2 - i +n^2 - 2in + i^2 + n - i}{2(n-1)}\\ & = & \frac{2i^2 +(-2n-2) i +n^2 + n}{2(n-1)} \end{array}

To find the overall expectation, we sum this over all i i and divide by n n .

i = 1 n 2 i 2 + ( 2 n 2 ) i + n 2 + n 2 n ( n 1 ) = 2 n ( n + 1 ) ( 2 n + 1 ) 12 n ( n 1 ) 2 n ( n + 1 ) 2 4 n ( n 1 ) + n 2 ( 1 + n ) 2 n ( 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 ) 6 ( n 1 ) = n + 1 3 = 20 \begin{array} { l l} & & \sum_{i=1}^{n}\frac{2i^2 +(-2n-2) i +n^2 + n}{2n(n-1)}\\ & = & \frac{2n(n+1)(2n+1)}{12n(n-1)} - \frac{2n(n+1)^2}{4n(n-1)} + \frac{n^2(1 + n)}{2n(n-1)}\\ & = & \frac{(n+1)(2n+1)}{6(n-1)} - \frac{3(n+1)(n+1)}{6(n-1)} + \frac{3n(n+1)}{6(n-1)}\\ & = & \frac{(n+1)(2n+1 -3n - 3 + 3n)}{6(n-1)}\\ & = & \frac{(n+1)(2n-2)}{6(n-1)}\\ & = & \frac{n+1}{3}\\ & = & 20\\ \end{array}

We could have also used symmetry to assume that i < j i < j and only sum these pairs.

Arman Özcan
Jul 24, 2019

Two numbers between 1-59 would be 20 and 40 on average. 40-20=20 is the answer.

Gwang Hyeon Choi
May 20, 2014

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 )

Nam Nguyen Hoang
May 20, 2014

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 ( 59 2 ) 59 \choose 2 ways to pick up two numbers (unordered).

Now, if i j = x |i-j| = x there are 59-x possible values of ( i , j ) (i,j) (unordered) x x can have value from 1 to 58. So the probability is: x = 1 x = 58 x ( 59 x ) ( 59 2 ) = 20 \frac{\sum_{x=1}^{x=58}{x*(59-x)}} {59 \choose 2} = 20

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}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...