English Explanations for checking this guide Same average wait? What expected value and variance tell you This companion brings together explanations included in the guide. For bus A, there is a 1/4 chance of waiting 2 minutes and a 3/4 chance of waiting 6 minutes. For bus B, the wait is always 5 minutes. These are invented schedules for the example. Using the probabilities, the average wait works out to 5 minutes for each bus. How does the spread compare? An expected value is an average weighted by probabilities. To compare how much the waits vary, we also look at how far each possible wait is from its expected value. We will use models with a finite list of possible values and a known probability for each value. Multiply each wait by its probability to find the expected value Call the wait for bus A X. Imagine four tickets, all equally likely to be drawn, with “2 minutes” on one and “6 minutes” on the other three. The chances of drawing those waits match the probabilities for X. The ticket average is (2 + 6 + 6 + 6) ÷ 4 = 5 minutes. Grouping by value gives 2 × 1/4 + 6 × 3/4 = 5 minutes. For bus B, 5 minutes with probability 1 also gives 5 minutes. We write the expected value as E[X]. Multiply each value by its probability, then add the products. For bus A, a single wait lasts 2 or 6 minutes. The 5-minute expected value represents the center after accounting for the chances of both waits. Use the same method in the first quiz question. X equals 0 with probability 1/4 and 4 with probability 3/4, so E[X] = 0 × 1/4 + 4 × 3/4 = 3. Square the deviations from the mean to find the variance For bus A, a 2-minute wait is 3 minutes below the 5-minute mean, and a 6-minute wait is 1 minute above it. The deviations are −3 and +1 minutes. Their signed weighted average is (−3) × 1/4 + 1 × 3/4 = 0. The negative and positive deviations cancel, so to measure spread, square each deviation before weighting it by the original probability. The weighted average of the squared deviations is the variance, written Var(X). For bus A, (−3)² × 1/4 + 1² × 3/4 = 3, in minutes squared. Bus B always has a deviation of zero, so its variance is zero minutes squared. To compare spreads in the original unit, take the square root of the variance. This gives the standard deviation, √3 minutes for bus A and 0 minutes for bus B. In the second quiz question, 0 and 2 each have probability 1/2, so the mean is 1. The deviations are −1 and +1. Both square to 1, so the variance is 1 × 1/2 + 1 × 1/2 = 1. Adding a fixed time shifts the mean, and changing units rescales the values Add a fixed 4-minute walk to the wait for bus A. The total is now 6 or 10 minutes and its mean is 9 minutes. Both values and their mean increase by the same amount. The deviations stay at −3 and +1 minutes, so the variance stays at 3 minutes squared. Express the wait for bus A in seconds. The waits of 2 and 6 minutes become 120 and 360 seconds, and their mean of 5 minutes becomes 300 seconds. The deviations become −180 and +60 seconds, 60 times their numerical values in minutes. The numerical variance is multiplied by 60², giving 10,800 seconds squared. The standard deviation is 60√3 seconds, the same duration as √3 minutes. In general, if Y = aX + b, the expected value of Y is aE[X] + b. The same b is added to each scaled value and to the scaled mean, so b cancels when you subtract. Each deviation for Y is a times the corresponding deviation for X. Squaring multiplies it by a², so Var(Y) = a²Var(X). In the third quiz question, Y = 3X, so its variance is multiplied by 9. Practice multiplying by two and adding one X equals 1 or 5, each with probability 1/2. Find the expected value, variance and standard deviation of Y = 2X + 1. The expected value of X is 3, and both squared deviations are 4. The expected value of Y is 2 × 3 + 1 = 7, its variance is 2² × 4 = 16, and its standard deviation is √16 = 4. You can check by listing the two values of Y. They are 3 and 11, so the deviations from 7 are −4 and +4, both with squared value 16. When you have measured wait times, grouping the values into intervals helps you see the distribution. The related article shows how to read frequencies in a histogram with unequal interval widths. How to practise List the possible values and their probabilities, and check that the probabilities add to 1. Multiply each value by its probability and add the products to find the expected value. Subtract the expected value from each value, square each deviation, then weight the squares by the original probabilities and add them to find the variance. Take the square root of the variance to express the spread as a standard deviation in the original unit. Find the deviations from the mean before squaring For 0 and 2 with equal probabilities, the mean of the raw squares is (0² + 2²) ÷ 2 = 2. To find the variance, square the deviations from the mean of 1. The average of (−1)² and 1² is 1, which measures the spread around the center. Example 1 X equals 0 with probability 1/4 and 4 with probability 3/4. What is E[X]? Choices 4 1 3 2 Answer: 3 An expected value is a probability-weighted average; it need not be an outcome of a single trial. Weight each value by its probability and add: 0 × 1/4 + 4 × 3/4 = 3. Example 2 X equals 0 or 2, each with probability 1/2. What is its variance? Choices 2 4 0 1 Answer: 1 The mean is 1. Both deviations, −1 and 1, have squared value 1, so their weighted average is 1. Example 3 Let Y = 3X. How does Var(Y) relate to Var(X)? Choices Var(X)+3 Var(X)/3 9Var(X) 3Var(X) Answer: 9Var(X) The deviations from the mean are multiplied by 3. Their squares are multiplied by 9, so Var(Y) = 9Var(X). 日本語 本文と例題の確認用説明 待ち時間の平均が同じなら? 期待値と分散で違いを読む この記事に掲載している説明をまとめた確認用の補足です。 バスAは、待ち時間が2分になる確率が1/4、6分になる確率が3/4です。バスBは毎回5分で来ます。これは説明のために作った設定です。確率を使って平均を計算すると、どちらも5分になります。待ち時間のばらつきはどうでしょうか。 確率で重みを付けた平均を期待値と呼びます。待ち時間の違いを比べるには、期待値からどれくらい離れるかも調べます。今回使うのは、取り得る値が有限個で、それぞれの確率が分かる場合です。 期待値を出すには、各待ち時間に確率を掛ける バスAの待ち時間をXとします。同じ確率で引ける4枚の札のうち1枚に「2分」、残り3枚に「6分」と書くと、Xと同じ確率で待ち時間が決まります。4枚の平均は (2 + 6 + 6 + 6) ÷ 4 = 5分です。値ごとにまとめて、2 × 1/4 + 6 × 3/4 = 5分と計算できます。バスBも、5分に確率1を掛けて5分です。 期待値を E[X] と書きます。各値とその確率を掛けた後、すべて足します。バスAの1回の待ち時間は2分か6分です。5分は、その二つの値の起こりやすさを反映した中心です。 クイズの1問目でも同じ手順を使います。Xが0を確率1/4、4を確率3/4で取るので、E[X] = 0 × 1/4 + 4 × 3/4 = 3です。 分散を出すには、平均との差を二乗する バスAの2分は平均5分より3分短く、6分は1分長いので、平均との差は −3分と +1分です。符号付きのまま平均すると、(−3) × 1/4 + 1 × 3/4 = 0になります。負のずれと正のずれが打ち消し合うため、ばらつきの大きさを見るには、差を二乗してから元の確率で重みを付けます。 この二乗した差の平均を分散と呼び、Var(X) と書きます。バスAでは (−3)² × 1/4 + 1² × 3/4 = 3で、単位は分²です。バスBでは平均との差が毎回0分なので、分散は0分²です。分散の平方根をとった標準偏差を使うと、元の単位で比べられます。Aは √3 分、Bは0分です。 クイズの2問目では、0と2がそれぞれ確率1/2なので、平均は1です。平均との差は −1と +1で、どちらも二乗すると1になるため、分散は1 × 1/2 + 1 × 1/2 = 1です。 一定の時間を足すと中心が移り、単位を変えると数値の尺度が変わる バスAの待ち時間に、毎回4分かかる移動を加えます。合計は6分か10分になり、平均は9分です。各値と平均が同じだけ増えるので、平均との差は −3分と +1分のままです。分散は3分²のままです。 バスAの待ち時間を秒で表すと、2分と6分は120秒と360秒、平均5分は300秒になります。平均との差は −180秒と +60秒で、分で表したときの数値を60倍したものです。分散の数値は60²倍の10,800となり、単位は秒²です。標準偏差は60√3秒で、√3分と同じ長さです。 一般に、Y = aX + b とすると、Yの期待値は aE[X] + b です。値と平均の両方にbを足すため、差を取るとbが消え、Yの平均との差はXの平均との差のa倍です。差の二乗はa²倍になるので、Var(Y) = a²Var(X) です。クイズの3問目では Y = 3X なので、分散は9倍になります。 練習 2倍してから1を足す Xが1または5をそれぞれ確率1/2で取ります。Y = 2X + 1 の期待値、分散、標準偏差を求めてみましょう。 Xの期待値は3、平均との差の二乗はどちらも4です。したがって、Yの期待値は 2 × 3 + 1 = 7、分散は 2² × 4 = 16、標準偏差は √16 = 4 です。Yの値を直接書き出すと3と11で、平均7からの差は −4と +4になります。どちらの差も二乗は16なので、同じ答えを確認できます。 実際に測った待ち時間の記録を読むときは、測定値を区間に分けると分布を把握しやすくなります。関連記事では、区間の幅が違うヒストグラムで度数を読み取る方法を扱います。 取り組み方 取り得る値と、それぞれの確率を書き出し、確率の合計が1になることを確かめる。 各値に確率を掛けて足し、期待値を求める。 各値から期待値を引いて二乗し、元の確率を掛けて足すと分散になる。 元の単位で広がりを表すには、分散の平方根を取って標準偏差を求める。 元の値を二乗する前に、平均との差を出す 0と2が同じ確率で出るとき、元の値の二乗を平均すると (0² + 2²) ÷ 2 = 2 です。分散で二乗するのは平均1からの差です。(−1)²と1²を平均すると1になり、中心からの広がりを表せます。 例題 1 Xが0を確率1/4、4を確率3/4で取る。E[X]は? 選択肢 4 1 3 2 正解:3 期待値は確率で重みを付けた平均で、一回の試行で必ず出る値ではありません。各値を確率で重み付けして足す。0/4+12/4。計算は3ですが、この問題の一回の結果は0か4です。 例題 2 Xが0と2をそれぞれ確率1/2で取る。分散は? 選択肢 2 4 0 1 正解:1 期待値は0×1/2+2×1/2=1です。分散は平均との差の二乗の平均なので、(0−1)²×1/2+(2−1)²×1/2=1です。元の値をそのまま二乗して平均した2は二次モーメントで、平均との差を取る段階が抜けています。平均との差を先に平均すると0になるため、広がりには二乗を使います。 例題 3 Y=3X。Var(Y)は? 選択肢 Var(X)+3 Var(X)/3 9Var(X) 3Var(X) 正解:9Var(X) 平均との差が3倍となり、その二乗は9倍。