Skip to content

Commit d32eea1

Browse files
committed
Clarify difference of average vs expected value
Resolves #1535
1 parent b09c5a1 commit d32eea1

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Change Log / Ray Tracing in One Weekend
2424
### The Rest of Your Life
2525
- Fix -- Fix typo of "arbitrary" (#1589)
2626
- New -- Added a bit more explanation of Buffon's needle problem (#1529)
27+
- Fix -- Clarify the distinction between average and expected value (#1535)
2728

2829

2930
----------------------------------------------------------------------------------------------------

books/RayTracingTheRestOfYourLife.html

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -522,14 +522,28 @@
522522
If we assume all of the above, then we could solve for the arithmetic mean--the average--of the list
523523
$Y$ with the following:
524524

525-
$$ \operatorname{average}(Y) = E[Y] = \frac{1}{N} \sum_{i=0}^{N-1} y_i $$
525+
$$ \operatorname{average}(Y_i) = E[Y] = \frac{1}{N} \sum_{i=0}^{N-1} y_i $$
526526
$$ = \frac{1}{N} \sum_{i=0}^{N-1} f(x_i) $$
527527
$$ = E[F(X)] $$
528528

529-
Where $E[Y]$ is referred to as the _expected value of_ $Y$. If the values of $x_i$ are chosen
530-
randomly from a continuous interval $[a,b]$ such that $ a \leq x_i \leq b $ for all values of $i$,
531-
then $E[F(X)]$ will approximate the average of the continuous function $f(x')$ over the the same
532-
interval $ a \leq x' \leq b $.
529+
Where $E[Y]$ is referred to as the _expected value of_ $Y$.
530+
531+
Note the subtle difference between _average value_ and _expected value_ here:
532+
533+
- A set may have many different subsets of selections from that set. Each subset has an _average
534+
value_, which is the sum of all selections divided by the count of selections. Note that a given
535+
item may occur zero times, one times, or multiple times in a subset.
536+
537+
- A set has only one _expected value_: the sum of _all_ members of a set, divided by the total
538+
number of items in that set. Put another way, the _expected value_ is the _average value_ of _all_
539+
members of a set.
540+
541+
It is important to note that as the number of random samples from a set increases, the average value
542+
of a set will converge to the expected value.
543+
544+
If the values of $x_i$ are chosen randomly from a continuous interval $[a,b]$ such that $ a \leq x_i
545+
\leq b $ for all values of $i$, then $E[F(X)]$ will approximate the average of the continuous
546+
function $f(x')$ over the the same interval $ a \leq x' \leq b $.
533547

534548
$$ E[f(x') | a \leq x' \leq b] \approx E[F(X) | X =
535549
\{\small x_i | a \leq x_i \leq b \normalsize \} ] $$

0 commit comments

Comments
 (0)