Skip to content

Commit d4860e4

Browse files
shudipto-aminleios
andauthored
Apply minor suggestions from Leios' code review
Mostly typos, spelling, punctuation, and grammar. Co-authored-by: James Schloss <jrs.schloss@gmail.com>
1 parent 0b7ad1f commit d4860e4

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

contents/probability/distributions/distributions.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ Both of the above examples are rather boring, because the value of $$P(n)$$ is t
4242
An example of a discrete probability function where the probability actually depends on $$n$$, is when $$n$$ is the sum of numbers on a __roll of two dice__.
4343
In this case, $$P(n)$$ is different for each $$n$$ as some possibilities like $$n=2$$ can happen in only one possible way (by getting a 1 on both dice), whereas $$n=4$$ can happen in 3 ways (1 and 3; or 2 and 2; or 3 and 1).
4444

45-
The rolling two dice is a great case study for how we can construct a probability distribution, since the probability varies and it is not immediately obvious how it varies.
45+
The example of rolling two dice is a great case study for how we can construct a probability distribution, since the probability varies and it is not immediately obvious how it varies.
4646
So let's go ahead and construct it!
4747

4848
Let's first define the domain of our target $$P(n)$$.
49-
We know that the lowest sum of two dice is 2 (a 1 on both dice), so $$n \geq 2$$ for sure. Similarly, the maximum is sum of two sixes, or 12, so $$n \leq 12$$ also.
49+
We know that the lowest sum of two dice is 2 (a 1 on both dice), so $$n \geq 2$$ for sure. Similarly, the maximum is the sum of two sixes, or 12, so $$n \leq 12$$ also.
5050

5151
So now we know the domain of possibilities, i.e., $$n \in [2..12]$$.
5252
Next, we take a very common approach - for each outcome $$n$$, we count up the number of different ways it can occur.
@@ -72,7 +72,7 @@ But we can get the probability by dividing $$f(n)$$ by the _total_ number of pos
7272
For two dice, that is $$N = 6 \times 6 = 36$$, but we could also express it as the _sum of all frequencies_,
7373

7474
$$
75-
N = \sum_n f(n)
75+
N = \sum_n f(n),
7676
$$
7777

7878
which would also equal to 36 in this case.
@@ -81,14 +81,14 @@ This process is called __normalization__ and is crucial for determining almost a
8181
So in general, if we have the function $$f(n)$$, we can get the probability as
8282

8383
$$
84-
P(n) = \frac{f(n)}{\displaystyle\sum_{n} f(n)}
84+
P(n) = \frac{f(n)}{\displaystyle\sum_{n} f(n)}.
8585
$$
8686

87-
Note that $$f(n)$$ does not necessarily have to be the frequency of $$n$$ - it could be any function which is _proportional_ to $$P(n)$$, and the above definition of $$P(n)$$ would still hold.
88-
And it's easy to check that the sum is now equal to 1, since
87+
Note that $$f(n)$$ does not necessarily have to be the frequency of $$n$$ &ndash; it could be any function which is _proportional_ to $$P(n)$$, and the above definition of $$P(n)$$ would still hold.
88+
It's easy to check that the sum is now equal to 1, since
8989

9090
$$
91-
\sum_n P(n) = \frac{\displaystyle\sum_{n}f(n)}{\displaystyle\sum_{n} f(n)} = 1
91+
\sum_n P(n) = \frac{\displaystyle\sum_{n}f(n)}{\displaystyle\sum_{n} f(n)} = 1.
9292
$$
9393

9494
Once we have the probability function $$P(n)$$, we can calculate all sorts of probabilites.
@@ -97,13 +97,13 @@ For brevity, we will use the notation $$\mathbb{P}(a \leq n \leq b)$$ to denote
9797
And to calculate it, we simply have to sum up all the probabilities for each value of $$n$$ in that range, i.e.,
9898

9999
$$
100-
\mathbb{P}(a \leq n \leq b) = \sum_{n=a}^{b} P(n)
100+
\mathbb{P}(a \leq n \leq b) = \sum_{n=a}^{b} P(n).
101101
$$
102102

103103
## Probability Density Functions
104104

105105
What if instead of a discrete variable $$n$$, we had a continuous variable $$x$$, like temperature or weight?
106-
In that case, it doesn't make sense to ask what the probability is of $$x$$ being _exactly_ a particular number - there are infinite possible real numbers, after all, so the probability of $$x$$ being exactly any one of them is essentially zero!
106+
In that case, it doesn't make sense to ask what the probability is of $$x$$ being _exactly_ a particular number &ndash; there are infinite possible real numbers, after all, so the probability of $$x$$ being exactly any one of them is essentially zero!
107107
But it _does_ make sense to ask what the probability is that $$x$$ will be _between_ a certain range of values.
108108
For example, one might say that there is 50% chance that the temperature tomorrow at noon will be between 5 and 15, or 5% chance that it will be between 16 and 16.5.
109109
But how do we put all that information, for every possible range, in a single function?
@@ -125,7 +125,7 @@ This is the defining feature of a probability density function:
125125
So if $$dx$$ is infinitesimally small, then the area of the green sliver becomes $$P(x)dx$$, and hence,
126126

127127
$$
128-
\mathbb{P}(x_0 \leq x \leq x_0 + dx) = P(x)dx
128+
\mathbb{P}(x_0 \leq x \leq x_0 + dx) = P(x)dx.
129129
$$
130130

131131
So strictly speaking, $$P(x)$$ itself is NOT a probability, but rather the probability is the quantity $$P(x)dx$$, or any area under the curve.
@@ -134,19 +134,19 @@ That is why we call $$P(x)$$ the probability _density_ at $$x$$, while the actua
134134
Thus, to obtain the probability of $$x$$ lying within a range, we simply integrate $$P(x)$$ between that range, i.e.,
135135

136136
$$
137-
\mathbb{P}(a \leq x \leq b ) = \int_a^b P(x)dx
137+
\mathbb{P}(a \leq x \leq b ) = \int_a^b P(x)dx.
138138
$$
139139

140140
This is analagous to finding the probability of a range of discrete values from the previous section:
141141

142142
$$
143-
\mathbb{P}(a \leq n \leq b) = \sum_{n=a}^{b} P(n)
143+
\mathbb{P}(a \leq n \leq b) = \sum_{n=a}^{b} P(n).
144144
$$
145145

146-
And the fact that all probabilities must sum to 1 translates to
146+
The fact that all probabilities must sum to 1 translates to
147147

148148
$$
149-
\int_D P(x)dx = 1
149+
\int_D P(x)dx = 1.
150150
$$
151151

152152
where $$D$$ denotes the __domain__ of $$P(x)$$, i.e., the entire range of possible values of $$x$$ for which $$P(x)$$ is defined.
@@ -157,7 +157,7 @@ Just like in the discrete case, we often first calculate some density or frequen
157157
We can get the probability density function by normalizing it in a similar way, except that we integrate instead of sum:
158158

159159
$$
160-
P(\mathbf{x}) = \frac{f(\mathbf{x})}{\int_D f(\mathbf{x})d\mathbf{x}}
160+
P(\mathbf{x}) = \frac{f(\mathbf{x})}{\int_D f(\mathbf{x})d\mathbf{x}}.
161161
$$
162162

163163
For example, consider the following __Gaussian function__ (popularly used in __normal distributions__),
@@ -170,24 +170,24 @@ which is defined for all real numbers $$x$$.
170170
We first integrate it (or do a quick google search, as it is rather tricky) to get
171171

172172
$$
173-
N = \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
173+
N = \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}.
174174
$$
175175

176-
and so we have a Gaussian probability distribution,
176+
Now we have a Gaussian probability distribution,
177177

178178
$$
179-
P(x) = \frac{1}{N} e^{-x^2} = \frac{1}{\sqrt{\pi}} e^{-x^2}
179+
P(x) = \frac{1}{N} e^{-x^2} = \frac{1}{\sqrt{\pi}} e^{-x^2}.
180180
$$
181181

182182
In general, normalization can allow us to create a probability distribution out of almost any function $$f(x)$$.
183183
There are really only two rules that $$f(\mathbf{x})$$ must satisfy to be a candidate for a probability density distribution:
184184
1. The integral of $$f(\mathbf{x})$$ over any subset of $$D$$ (denoted by $$S$$) has to be non-negative (it can be zero):
185185
$$
186-
\int_{S}f(\mathbf{x})d\mathbf{x} \geq 0
186+
\int_{S}f(\mathbf{x})d\mathbf{x} \geq 0.
187187
$$
188188
2. The following integral must be finite:
189189
$$
190-
\int_{D} f(\mathbf{x})d\mathbf{x}
190+
\int_{D} f(\mathbf{x})d\mathbf{x}.
191191
$$
192192

193193
<script>

0 commit comments

Comments
 (0)