-
Notifications
You must be signed in to change notification settings - Fork 0
/
math3280.tex
2517 lines (1691 loc) · 94.7 KB
/
math3280.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% ------------------------------------------------------------ %
%
% CUHK Mathematics
% MATH3280: Introductory Probability
%
% ------------------------------------------------------------ %
\documentclass[a4paper,12pt]{article}
\usepackage{standalone}
\input{sty/setup.sty}
\begin{document}
\title{MATH3280: Introductory Probability}
\input{sty/cover.sty}
\remark{}
\input{sty/header.sty}
\section{Axioms of Probability}
\subsection{Introduction to Probability}
\subsubsection{Definition of Probability}
\begin{dft}
\textbf{Probability} is a study of random behaviours in mathematics.
\end{dft}\n
Probability has a history of more than $300$ years, which comes from gambling and games of chance.
\subsubsection{Terminologies of Probability}
Probability involves \textbf{random experiments} and \textbf{outcomes}.\n
\begin{exm}
Below are examples of random experiments and their corresponding outcomes:
\begin{alist}
\item Toss a coin once to obtain a head or a tail.
\item Roll a die once to see the number of the top face.
\item Randomly choose a student in the class and measure the height of the student.
\end{alist}
\end{exm}\n
\begin{dft}
\textbf{Sample space}, usually denoted by $S$, is the set of all possible outcomes of a random experiment.
\end{dft}\n
\begin{exm}
Below are examples of sample spaces of random experiments:
\begin{alist}
\item For tossing a coin once, the sample space $S=\brc{H,T}$ where $H$ represents head and $T$ represents tail.
\item For tossing a coin twice, the sample space $S=\brc{HH, HT, TH, TT}$.
\item For rolling a die $4$ times to record the numbers appearing in the top face, the sample space $S=\brc{(x_{1},x_{2},x_{3},x_{4})\srm x_{i}\in\brc{1,2,3,4,5,6},1\leq i\leq 4}$.
\item For the height of a random student in the campus (in meters), $S=\brc{0\leq x\leq\infty}$.
\end{alist}
\end{exm}\n
\begin{dft}
Let $S$ denote the sample space of a random experiment, then any subset $E$ of $S$ is called an \textbf{event} of the experiment.
\end{dft}\n
If the outcome of an experiment is contained in event $E$, then $E$ is said to be \textbf{occured}. Note that some special events always occurs or not occurs. For example, a \textbf{null event}, denoted by $\phi$, never occurs in any random experiment.
\subsection{Probability Operations}
\subsubsection{Basic Operations on Events}
Below are some basic operations on events:\n
\begin{pst}
Let $E$ and $F$ are events of a random experiment, then the following applies:
\begin{alist}
\item \textbf{Intersection} of $E$ and $F$, denoted by $E\cap F$.
\item \textbf{Union} of $E$ and $F$, denoted by $E\cup F$.
\item \textbf{Complement} of $E$, denoted by $E^{c}$.
\end{alist}
\end{pst}\n
In order to understand basic operations on events, \textbf{Venn diagram} is introduced. In Venn diagram, a rectangular region represents a sample space, while a (usually circular) region within the rectangular region represents an event.
\subsubsection{Laws of Event Operations}
There are three basic laws of event operations:\n
\begin{pst}
The \textbf{Communtative Law} states that $E\cap F=F\cap E$ and $E\cup F=F\cup E$.
\end{pst}\n
\begin{pst}
The \textbf{Associative Law} states that $E\cup(F\cup G)=(E\cup F)\cup G$ and $E\cap(F\cap G)=(E\cap F)\cap G$.
\end{pst}\n
\begin{pst}
The \textbf{Distributive Law} states that $E\cap(F\cup G)=(E\cap F)\cup(E\cup G)$ and $E\cup(F\cap G)=(E\cup F)\cap(E\cup G)$.
\end{pst}\n
Besides the three basic laws, another common law is the \textbf{De Morgan's Laws}.\n
\begin{thm}
De Morgan's Laws state that
$$\brr{\bigcup_{n=1}^{\infty}E_{n}}^{c}=\bigcap_{n=1}^{\infty}E_{n}^{c}$$\s
$$\brr{\bigcap_{n=1}^{\infty}E_{n}}^{c}=\bigcup_{n=1}^{\infty}E_{n}^{c}$$\s
\prf Note that
$$\begin{aligned}[t]
x\in{\bigcup_{n=1}^{\infty}E_{n}}^{c}&\Leftrightarrow x\in S,x\not\in\bigcup_{n=1}^{\infty}E_{n}\\
&\Leftrightarrow x\in S, x\in E_{n}\text{ for all }n\\
&\Leftrightarrow x\in S\setminus E_{n}\text{ for all }n\\
&\Leftrightarrow x\in \bigcap_{n=1}^{\infty}E_{n}^{c}
\end{aligned}$$\s
The other law can be proved by using the same technique.
\end{thm}
\subsection{Axioms and Properties of Probability}
\subsubsection{Axiomatic Approach to Probability}
It is an important question knowing how to define the probability of an event, or how likely an event will happen in an experiment. An inituitive approach in define the probability is to repeat the experiment $n$ times, so if the experiment is done for numerous times and $n(E)$ is number of times that an event $E$ has occured, then the probability of $E$
$$P(E)=\lim_{n\to\infty}\frac{n(E)}{n}$$\s
This is a natural idea to define probability as the probability should be higher if the chance that the event will happen is higher. However, one have to consider the drawbacks of the definition above. It is unsure that the limit exists or not, and even if the limit exists, it is dependent of the experiments conducted.\n
The definition above may not be vigorous enough, but it is understandable. However, in order to have a vigorous definition, \textbf{axiomatic approach to probability} is used. Such approach is proposed by Kolmogrov in the $20$th century.\n
\begin{dft}
Let $S$ be the sample space of an experiment, then probability $P$ on $S$ is a function which assigns a value to each event $E$ of $S$ such that the following axioms hold:
\begin{alist}
\item\textbf{Axiom $1$}
$$0\leq P(E)\leq 1\erm{for all }E\subset S$$
\item\textbf{Axiom $2$}
$$P(S)=1$$
\item\textbf{Axiom $3$}\n
Let $E_{1},E_{2},\cdots$ be a sequence of events that are mutually exclusive, or in other words, $E_{i}\cap E_{j}=\phi\erm{if }i\neq j$, then
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}=\sum_{n=1}^{\infty}P(E_{n})$$
\end{alist}
\end{dft}\n
Note that the last axiom of the definition above is also called the \textbf{countable additivity of probability}.
\subsubsection{Properties of Probability}
\begin{pst}
A null event has probability of $0$, or $P(\phi)=0$.\n
\prf Let $(E_{n})_{n=1}^{\infty}$ be a sequence of event by $E_{1}=S$ and $E_{2}=E_{3}=\cdots=\phi$. Since the events are mutually disjoint, then by Axiom $3$,
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}=\sum_{n=1}^{\infty}P(E_{n})=P(S)+P(\phi)+P(\phi)+\cdots$$\s
Note that left hand side of the equation is $1$ by Axiom $1$, and $P(S)=1$ by Axiom $2$. Therefore $P(\phi)=0$ in order to hold the equation above.
\end{pst}\n
\begin{pst}
Let $E\subset S$ be an event, then probability of complement of $E$, $P(E^{c})=1-P(E)$.\n
\prf Let $(E_{n})_{n=1}^{\infty}$ be a sequence of event by $E_{1}=E$, $E_{2}=E^{c}$ and $E_{3}=E_{4}=\cdots=\phi$. Since the events are mutually disjoint, then by Axiom $3$,
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}=\sum_{n=1}^{\infty}P(E_{n})=P(E)+P(E^{c})+P(\phi)+P(\phi)+\cdots$$\s
Note that left hand side of the equation is $1$ by Axiom $1$, and $P(S)=1$ by Axiom $2$. Therefore $P(E)+P(E^{c})=1$ in order to hold the equation above. Rearrange the equation finishes the proof.
\end{pst}\n
The following proposition is the \textbf{finite additivity} of disjoint events:\n
\begin{pst}
Let $E_{1},E_{2},\cdots,E_{n}$ be disjoint events, then
$$P\brr{\bigcup_{i=1}^{n}E_{i}}=\sum_{i=1}^{n}P(E_{i})$$\s
\prf Let $E_{n+1}=E_{n+2}=\cdots=\phi$, then $(E_{n})_{n=1}^{\infty}$ is disjoint. By Axiom $3$,
$$P\brr{\bigcup_{i=1}^{\infty}E_{i}}=\sum_{i=1}^{\infty}P(E_{i})$$\s
and the equation is reduced to desired equation by using Axiom $1$ and $2$.
\end{pst}\n
\begin{pst}
Let $E$ and $F$ be two events, then $P(E\cup F)=P(E)+P(F)-P(E\cap F)$.\n
\prf Venn diagram shows the result explicitly. On the other hand, note that $E\cup F=E\cup(F\setminus E)$. By Axiom $3$ and \rpst[\sctr{1}],
$$P(E\cup F)=P(E\cup(F\setminus E))=P(E)+P(F\setminus E)$$\s
Also notice that $F=(F\setminus E)\cup(E\cap F)$, hence
$$P(F)=P(F\setminus E)+P(E\cap F)$$\s
Combine both equations by substituting $P(F\setminus E)$ gives the result.
\end{pst}\n
\begin{pst}
Let $E$ and $F$ be two events. If $E\subset F$, then $P(E)\leq P(F)$.\n
\prf Note that $F=E\cup(F\setminus E)$, then
$$P(F)=P(E)+P(F\setminus E)\geq P(E)$$
\end{pst}\n
The following proposition, which is also called the \textbf{inclusion-exclusion identity}, is the generalization of \rpst[\sctr{1}]:\n
\begin{pst}
Let $E_{1},E_{2},\cdots,E_{n}$ be events, then
$$\begin{aligned}[t]
P(E_{1}\cup E_{2}\cup\cdots\cup E_{n})&=\sum_{i=1}^{n}P(E_{i})-\sum_{i_{1}<i_{2}}P(E_{i_{1}}\cap E_{i_{2}})\\
&-\sum_{i_{1}<i_{2}<i_{3}}P(E_{i_{1}}\cap E_{i_{2}}\cap E_{i_{3}})\\
&+\cdots+(-1)^{n+1}P(E_{1}\cap E_{2}\cap\cdots\cap E_{n})\\
&=\sum_{r=1}^{n}(-1)^{r+1}\sum_{i_{1}<i_{2}<\cdots<i_{r}}P(E_{i_{1}}\cap E_{i_{2}}\cap\cdots\cap E_{i_{r}})
\end{aligned}$$
\end{pst}\n
\begin{exm}
Let $E,F\in S$ be events. Suppose $P(E)=0.8$ and $P(F)=0.9$, prove that $P(E\cap F)\geq 0.7$.\n
\ans By the inclusion-exclusion identity,
$$\begin{aligned}[t]
P(E\cap F)&=P(E)+P(F)-P(E\cup F)\\
&\geq P(E)+P(F)-1=0.7
\end{aligned}$$
\end{exm}\n
\begin{exm}
Let $E,F\in S$ be events. Suppose $P(E)=0.8$, $P(F)=0.9$ and $P(E\cap F)=0.75$. Find the probability that exactly one of $E$ and $F$ has occured.\n
\ans Let $G$ be the required event. Note that $G=(E\setminus F)\cup(F\setminus E)$ is a union of mutually exclusive events, then
$$\begin{aligned}[t]
P(G)&=P(E\setminus F)+P(F\setminus E)\\
&=P(E)-P(E\cap F)+P(F)-P(F\cap E)=0.2
\end{aligned}$$
\end{exm}
\subsubsection{Mutually Disjoint Events}
\begin{dft}
Let $E_{1},E_{2},\cdots,E_{n}$ be events, then union of $(E_{i})_{i=1}^{n}$ can be expressed as a union of mutually disjoint events $(F_{i})_{i=1}^{n}$ by
$$\begin{cases}
F_{1}=E_{1}\\
F_{k}=E_{k}\setminus\bigcup_{i=1}^{k-1}E_{i}
\end{cases}$$\s
\end{dft}\n
Note that $F_{n}\subset E_{n}$ for any $n$. The above definition helps to convert any set of events into a set of mutually exclusive events, so that axioms and properties of probability can be used.\n
\begin{pst}
Let $(F_{n})_{n=1}^{\infty}$ as in \rdft[\sctr{1}], then $F_{n}\cap F_{m}=\phi$ for any $n\neq m$.\n
\prf Without loss of generality, assume $n>m$, then
$$\begin{aligned}[t]
F_{n}&=E_{n}\setminus(E_{1}\cup\cdots\cup E_{m}\cup\cdots\cup E_{n-1})\\
F_{n}\cap E_{m}&=\phi
\end{aligned}$$\s
but since $F_{m}\subset E_{m}$, $F_{n}\cap F_{m}=\phi$.
\end{pst}\n
The proposition above ensures that $(F_{n})_{n=1}^{\infty}$ are mutually exclusive.\n
\begin{pst}
Let $(F_{n})_{n=1}^{\infty}$ as in \rdft[\sctr{2}], then
$$\bigcup_{i=1}^{n}F_{i}=\bigcup_{i=1}^{n}E_{i}$$\s
\end{pst}
The next proposition is the \textbf{countable subadditivity} of probability:\n
\begin{pst}
Let $E_{1},E_{2},\cdots,E_{n}$ be events, then
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}\leq\sum_{n=1}^{\infty}P(E_{n})$$\s
\prf Let $(F_{n})_{n=1}^{\infty}$ as in \rdft[\sctr{3}], then by \rpst[\sctr{2}], \rpst[\sctr{1}] and applying Axiom $3$ to $(F_{n})$,
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}=P\brr{\bigcup_{n=1}^{\infty}F_{n}}=\sum_{n=1}^{\infty}P(F_{n})\leq\sum_{n=1}^{\infty}P(E_{n})$$
\end{pst}\n
\subsubsection{Continuity of Probability}
Continuity of probability consists of two parts, which involves increasing and decreasing subsets of events respectively.
\begin{pst}
Let $E_{1}\subset E_{2}\subset\cdots\subset E_{n}\subset\cdots$ be increasing, then
$$P\brr{\bigcup_{n=1}^{\infty}E_{n}}=\lim_{n\to\infty}P(E_{n})$$\s
\prf Let $(F_{n})_{n=1}^{\infty}$ as defined in \rdft{\sctr{2}}. Since $(F_{n})_{n=1}^{\infty}$ are mutually disjoint,
$$\bigcup_{i=1}^{n}F_{i}=\bigcup_{i=1}^{n}E_{i}=E_{n}$$\s
and
$$\bigcup_{i=1}^{\infty}F_{i}=\bigcup_{i=1}^{\infty}E_{i}$$\s
Applying Axiom $3$ to $(F_{n})$ gives
$$\begin{aligned}[t]
P\brr{\bigcup_{n=1}^{\infty}E_{n}}&=P\brr{\bigcup_{n=1}^{\infty}F_{n}}\\
&=\sum_{n=1}^{\infty}P(F_{n})\\
&=\lim_{n\to\infty}\brr{\sum_{i=1}^{n}P(F_{i})}\\
&=\lim_{n\to\infty}P\brr{\bigcup_{i=1}^{n}F_{i}}\\
&=\lim_{n\to\infty}P(E_{n})
\end{aligned}$$
\end{pst}\n
\begin{pst}
Let $E_{1}\supset E_{2}\supset\cdots\supset E_{n}\supset\cdots$ be increasing, then
$$P\brr{\bigcap_{n=1}^{\infty}E_{n}}=\lim_{n\to\infty}P(E_{n})$$\s
\prf Consider
$$1-P\brr{\bigcap_{n=1}^{\infty}E_{n}}=P\brr{\brr{\bigcap_{n=1}^{\infty}E_{n}}^{c}}=P\brr{\bigcup_{n=1}^{\infty}E_{n}^{c}}$$\s
by De Morgan's Law. Apply the proof in \rpst[\sctr{1}] gives
$$1-P\brr{\bigcap_{n=1}^{\infty}E_{n}}=\lim_{n\to\infty}(1-P(E_{n}))$$\s
Rearrange the equation finishes the proof.
\end{pst}
\subsubsection{Cardinality of Events}
\begin{dft}
Let $E$ be an event in $S$. The \textbf{cardinality} of event $E$, denoted by $\#E$, is the number of outcomes occured in the sample space of the experiment.
\end{dft}\n
In many experiments, it can be assumed that all outcomes of the experiment have the same chance to occur, then $P(E)=\#E/\#S$.\n
\begin{exm}
Find the probability that the sum of top faces of two dice is equal to $5$.\n
\ans Let $E$ be the required event. Note that
$$S=\brc{(i,j)\srm i,j\in\brc{1,2,3,4,5,6}}$$\s
and
$$E=\brc{(i,j)\in S\srm i+j=5}=\brc{(1,4),(2,3),(3,2),(4,1)}$$\s
Hence
$$P(E)=\frac{\#E}{\#S}=\frac{4}{36}=\frac{1}{9}$$
\end{exm}\n
\begin{exm}
A committee of $5$ is to be selected from a group of $6$ men and $9$ women. If the selection is made randomly, find the probability that the committee consists of $3$ men and $2$ women.\n
\ans Let $E$ be the required event. Note that $P(E)=\#E/\#S$ where
$$\#S=\binom{15}{5},\;\#E=\binom{6}{3}\binom{9}{2}$$
\end{exm}\n
\begin{exm}
In the game of bridge, the entire deck of $52$ cards is dealt out to $4$ players. Find the probability that
\begin{alist}
\item one of the players receives all $13$ spades.
\item each player receives an ace.
\end{alist}
\ans\prt[a]{zb} Note that the cardinality of sample space is
$$\#S=\binom{52}{13}\binom{39}{13}\binom{26}{13}\binom{13}{13}$$
Let $E$ be the required event, and $E_{i}$ be the event where the $i$-th player receives all spades. Note that $E=\bigcup_{i=1}^{4}E_{i}$ with $E_{i}$ being mutually exclusive. The $i$-th player first receives spades, other players share the remaining cards, then
$$\#E_{i}=\binom{13}{13}\binom{39}{13}\binom{26}{13}\binom{13}{13}$$\s
Therefore
$$P(E)=\frac{\#E}{\#S}=\frac{4\#E_{i}}{\#S}$$
\prtc[b]{zb} Let $F$ be the required event. Each player first get an ace, then take $12$ cards from the non-ace pile, then
$$\#F=\brr{\binom{4}{1}\binom{48}{12}}\brr{\binom{3}{1}\binom{36}{12}}\brr{\binom{2}{1}\binom{24}{12}}\binom{13}{13}$$\s
and $P(F)=\#F/\#S$.
\end{exm}
\subsection{Conditional Probability and Independence}
\subsubsection{Conditional Probability}
Below is an example of probability with given conditions.\n
\begin{exm}
Two fair dice are rolled. Given that the first die is a $4$, find the probability that the sum of two dice is $9$.
\end{exm}\n
Normally without additional conditions, the event that the sum of two dice is equal to $9$, denoted by $E$, has outcomes $\brc{(3,6),(4,5),(5,4),(6,3)}$. It is easy to find out $P(E)=1/9$. Similarly, the event that the first die is a $4$, denoted by $F$, has outcomes $\brc{(4,1),(4,2),(4,3),(4,4),(4,5),(4,6)}$.\n
With conditions, it is assumed that $F$ has occured. Note that $E\cap F=\brc{(4,5)}$, so the probability of $E$ given $F$ is $1/6$.\n
\begin{dft}
Let $E$ and $F$ be two events in a random experiment. Suppose $P(F)>0$, then the \textbf{conditional probability} of $E$ given $F$, denoted by $P(E\mid F)$, is given by
$$P(E\mid F)=\frac{P(E\cap F)}{P(F)}$$
\end{dft}\n
Note that if $P(F)=0$, $P(E\mid F)$ is then not well-defined.\n
\begin{exm}
A fair coin is flipped $3$ times. Find the conditional probability that the third flip is a head, given that the first flip is a tail.\n
\ans Let $E$ be the event that the first lip is a tail and $F$ be the event that the third flip is a head. By \rdft[\sctr{1}],
$$P(F\mid E)=\frac{P(F\cap E)}{P(E)}=\frac{2/8}{4/8}=\frac{1}{2}$$\s
\end{exm}\n
The following proposition is also called \textbf{multiplicative rule}.\n
\begin{pst}
Let $E_{i}$ be events, then
$$\begin{aligned}[t]
P(E_{1}\cap E_{2}\cap\cdots\cap E_{n})=&P(E_{1})P(E_{2}\mid E_{1})P(E_{3}\mid(E_{1}\cap E_{2}))\cdots\\
&P(E_{n}\mid(E_{1}\cap E_{2}\cap\cdots\cap E_{n-1}))
\end{aligned}$$\s
\prf Rearrange \rdft[\sctr{2}] gives
$$P(E_{1}\cap E_{2})=P(E_{1})P(E_{2}\mid E_{1})$$\s
and can be extended to case of $n$ events by induction.
\end{pst}
\subsubsection{Bayes Formula}
Before introducing the main formula, consider the following proposition which is also known as \textbf{total probability formula}:\n
\begin{pst}
Let $E$ and $F$ be two events, then
$$P(E)=P(F)P(E\mid F)+P(F^{c})P(E\mid F^{c})$$\s
\prf Note that
$$E=(E\cap F)\cup(E\cap F^{c})$$\s
and since both events in $E$ are mutually exclusive,
$$P(E)=P(E\cap F)+P(E\cap F^{c})$$\s
By multiplicative rule,
$$P(E)=P(F)P(E\mid F)+P(F^{c})P(E\mid F^{c})$$
\end{pst}\n
This formula works for any event $F$, and it is said to be a conditioning method for calculating unconditional probability.\n
\begin{dft}
Let $E_{1},E_{2},\cdots,E_{n}$ be events, then the events are \textbf{exhausitive} if
$$\bigcup_{i=1}^{n}E_{i}=S$$
\end{dft}\n
Below is a generalized formula of \rpst[\sctr{1}]:\n
\begin{crl}
Let $E$ be an event, and $F_{1},F_{2},\cdots,F_{n}$ be mutually exclusive and exhausitive events, then
$$P(E)=\sum_{i=1}^{n}P(F_{i})P(E\mid F_{i})$$\s
\prf Note that $E\cap F_{i}$ are mutually disjoint, so
$$\begin{aligned}[t]
P(E)&=\sum_{i=1}^{n}P(E\cap F_{i})\\
&=\sum_{i=1}^{n}P(F_{i})P(E\mid F_{i})
\end{aligned}$$
\end{crl}\n
With the formula above, \textbf{Bayes formula} is introduced as below:\n
\begin{thm}
Let $F_{1},F_{2},\cdots,F_{n}$ be mutually exclusive and exhausitive events, then
$$P(F_{i}\mid E)=\frac{P(F_{i})P(E\mid F_{i})}{\sum_{j=1}^{n}P(F_{j})P(E\mid F_{j})}$$\s
\prf By total probability formula,
$$P(E)=\sum_{j=1}^{n}P(F_{j})P(E\mid F_{j})$$\s
The proof is finished by applying \rdft[\sctr{5}] with $P(E\cap F_{i})=P(F_{i})P(E\mid F_{i})$.
\end{thm}\n
\begin{exm}
A bin contains $3$ different types of disposable flashlights, which are type $1$, $2$ and $3$. Each type of flashlight has a probability of $0.7$, $0.4$ and $0.3$ respectively to give over $100$ hours of use. Suppose $20\%$ of the flashlights are type $1$, $30\%$ of the flashlights are type $2$ and $50\%$ of the flashlights are type $3$.
\begin{alist}
\item Find the probability that a randomly chosen flashlight will give more than $100$ hours of use.
\item Given that a flashlight lasted over $100$ hours, what is the conditional probability that it was type $1$, $2$ or $3$.
\end{alist}
\ans\prt[a]{zb} Let $E$ be the event that the flashlight gives more than $100$ hours of use and $F_{j}$ be the event that the flashlight is of type $j$. Note that $P(F_{1})=0.2$, $P(F_{2})=0.3$ and $P(F_{3})=0.5$, while $P(E\mid F_{1})=0.7$, $P(E\mid F_{2})=0.4$ and $P(E\mid F_{3})=0.3$, then
$$P(E)=\sum_{j=1}^{3}P(F_{j})P(E\mid F_{j})=0.2(0.7)+0.3(0.4)+0.5(0.3)=0.41$$\s
\prtc[b]{zb} Without loss of generality,
$$P(F_{j}\mid E)=\frac{P(F_{j})P(E\mid F_{j})}{P(E)}$$\s
by the definition of conditional probability.
\end{exm}\n
\begin{exm}
Two fair dice are rolled. Find the conditional probability that at least one of them is $6$ given that the dice land on different numbers.\n
\ans Let $E$ be the event where at least one of the dice is $6$, and $F$ be the event that two dice land on different numbers. Note that $\#S=36$, $\#F=30$ and $\#(E\cap F)=10$, so
$$P(E\mid F)=\frac{P(E\cap F)}{P(F)}=\frac{10/36}{30/36}=\frac{1}{3}$$
\end{exm}\n
\subsubsection{Conditional Independence}
For most of the cases, $P(E\mid F)$ is not equal to $P(E)$, but there are some special cases where they are equal.\n
\begin{dft}
Let $E$ and $F$ be events, then $E$ is said to be \textbf{independent} of $F$ if $P(E\mid F)=P(E)$.
\end{dft}\n
The following proposition shows the symmetric property of conditional independence:\n
\begin{pst}
Let $E$ and $F$ be events, then $E$ and $F$ are independent if $P(E\cap F)=P(E)P(F)$.\n
\prf By the definition of conditional probability in \rdft[\sctr{8}], if $E$ is independent of $F$, then
$$P(E\mid F)=\frac{P(E\cap F)}{P(F)}=P(E)$$\s
which means $P(E\cap F)=P(E)P(F)$. Apply the definition again gives $P(F\mid E)=P(F)$, hence $F$ is also independent of $E$.
\end{pst}\n
\begin{exm}
A card is randomly chosen from a deck to $52$ playing cards. Let $E$ be the event that the chosen card is an ace, and $F$ be the event that the chosen card is a spade. Check whether $E$ and $F$ are independent.\n
\ans Since
$$P(E\cap F)=\frac{1}{52}=\frac{1}{13}\brr{\frac{1}{4}}=P(E)P(F)$$\s
$E$ and $F$ are independent.
\end{exm}\n
Below are some properties of conditional independence:\n
\begin{pst}
If $E$ and $F$ are independent events, then the following applies:
\begin{alist}
\item $E$ and $F^{c}$ are independent.
\item $E^{c}$ and $F^{c}$ are independent.
\end{alist}
\prf Since $E$ and $F$ are independent, $P(E\cap F)=P(E)P(F)$. Notice that
$$\begin{aligned}[t]
P(E\cap F^{c})&=P(E)-P(E\cap F)\\
&=P(E)-P(E)P(F)\\
&=P(E)(1-P(F))=P(E)P(F^{c})
\end{aligned}$$\s
then $E$ and $F^{c}$ are independent. It then follows that $E^{c}$ and $F^{c}$ are independent by applying the same method on $E$.
\end{pst}\n
It is also important to discuss about conditional independence for more than $2$ events. For simplicity, definition of $3$ events is first introduced:\n
\begin{dft}
Let $E$, $F$ and $G$ are events, then they are independent if the following are satisfied:
\begin{alist}
\item $P(E\cap F\cap G)=P(E)P(F)P(G)$.
\item For any two events, they are independent to each other. In other words, $E$ and $F$ are independent, $E$ and $G$ are independent, and $F$ and $G$ are independent.
\end{alist}
\end{dft}\n
\begin{dft}
Let $\brc{E_{1},E_{2},\cdots,E_{n}}$ be a finite family of events, then they are independent if
$$P(E_{1}\cap E_{2}\cap\cdots\cap E_{n})=\prod_{i=1}^{n}P(E_{i})$$\s
and for any subfamily $\brc{E_{j_{1}},E_{j_{2}},\cdots,E_{j_{k}}}$, they are independent.\n
Furthermore, an infinite family of events are said to be independent if any finite subfamily of events are independent.
\end{dft}\n
\begin{dft}
A random experiment consists of \textbf{subexperiments} if the events $E_{1},E_{2},\cdots,E_{n}$ are independent where $E_{i}$ is an event whose occurence only depends on the $i$-th subexperiment.
\end{dft}
\pagebreak
\section{Random Variables}
\subsection{Introduction to Random Variables}
\subsubsection{Definition of Random Variables}
\begin{dft}
In a random experiment, a \textbf{random variable}, denoted by $X$, is a real-valued function defined on the sample space $S$.
\end{dft}\n
With the definition above, random variable $X$ is a function that maps from the sample space $S$ to the real number set $\R$. Since $S$ has outcomes of random phenomenon, $X$ that depends on $S$ is random. The following example demonstrates its randomness:\n
\begin{exm}
Three fair coins are flipped. Let $X$ be the number of heads appeared. Note that $X=2$ if the outcome is $(H,T,H)$, and $X=0$ if the outcome is $(T,T,T)$.
\end{exm}\n
Random variable $X$ does not always reflect the outcome explicitly, as shown in the following example:\n
\begin{exm}
Two fair dice are rolled. Let $X$ be the product of the two numbers appeared. Note that $X=12$ if the outcome is $(2,6)$ or $(4,3)$.
\end{exm}
\subsubsection{Discrete Random Variables}
\begin{dft}
Let $X$ be a random variable, then $X$ is said to be \textbf{discrete} if it takes at most countably many different values.
\end{dft}\n
With a discrete random variable, it is also important to know how to measure the probability of values of $X$. There is a function that can fulfill the purpose above.\n
\begin{dft}
Let $X$ be a discrete random variable. For any $a\in\R$, the \textbf{probability mass function} of $a$, denoted by $p(a)$, is defined as
$$p(a)=P(\brc{X=a})=P(\brc{\omega\in S\srm X(\omega)=a})$$
\end{dft}\n
In general, $p$ is called the probability mass function of $X$.\n
\begin{pst}
Let $x_{1},x_{2},\cdots,x_{n}$ be all possible values of a discrete random variable $X$, then
$$p(a)=0\erm{if }a\not\in\brc{x_{1},x_{2},\cdots,x_{n}}$$\s
and
$$\sum_{i=1}^{n}p(x_{i})=1$$\s
\prf Let $E_{i}=\brc{\omega\in S\srm X(\omega)=x_{i}}$, then $E_{i}$ are mutually exclusive. Moreover, since $\bigcup_{i=1}^{n}E_{i}=S$,
$$1=P\brr{\bigcup_{i=1}^{n}E_{i}}=\sum_{i=1}^{n}P(E_{i})=\sum_{i=1}^{n}p(x_{i})$$
\end{pst}
\subsubsection{Expected Value of Discrete Random Variables}
\begin{dft}
Let $X$ be a discrete random variable, and $p$ be the probability mass function of $X$, then the \textbf{expected value} of $X$, denoted by $E[X]$, is defined as
$$E[X]=\sum_{p(a)>0}ap(a)=\sum_{i}x_{i}p(x_{i})$$\s
where $x_{i}$ are possible values of $X$.
\end{dft}\n
From the definition above, it can be seen that expected value of $X$ is a weighted average of $X$. The weight depends on the probability of occurence of each value. Therefore, expected value of $X$ is sometimes called the mean of $X$.\n
\begin{exm}
Let $X$ be a discrete random variable to represent number of heads appeared in three fair coins, then the expected value of $X$
$$E[X]=0\brr{\frac{1}{8}}+1\brr{\frac{3}{8}}+2\brr{\frac{3}{8}}+3\brr{\frac{1}{8}}=\frac{3}{2}$$
\end{exm}\n
Now let $X$ be a discrete random variable on $S$, $g:\R\to\R$ be a function such that $Y=g(X)$, where $Y$ is a function on $S$. Observe that if $x_{i}$ are possible values of $X$, then $g(x_{i})$ are possible values of $Y$, so $Y$ is another discrete random variable on $S$. The following proposition shows a way to calculate expected value of $Y$ simply by values in $X$:\n
\begin{pst}
Let $X$ and $Y$ be discrete random variables on $S$ where $Y=g(X)$ by a function $g:\R\to\R$, then
$$E[Y]=\sum_{i}g(x_{i})p(x_{i})$$\s
\prf Let $y_{i}$ be possible unique values of $Y$. Grouping $g(x_{i})$ with the same value gives
$$\begin{aligned}[t]
\sum_{i}g(x_{i})p(x_{i})&=\sum_{j}\sum_{g(x_{i})=y_{j}}g(x_{i})p(x_{i})\\
&=\sum_{j}\sum_{g(x_{i})=y_{j}}y_{j}p(x_{i})\\
&=\sum_{j}y_{j}\sum_{g(x_{i})=y_{j}}p(x_{i})\\
&=\sum_{j}y_{j}\sum_{g(x_{i})=y_{j}}P(\brc{X=x_{i}})\\
&=\sum_{j}y_{j}P(\brc{Y=y_{j}})\\
&=E[Y]
\end{aligned}$$
\end{pst}\n
\begin{crl}
Let $X$ be a discrete random variable and $a,b\in\R$, then
$$E[aX+b]=aE[X]+b$$\s
\prf Let $g(x)=ax+b$ be a function. By \rpst[\sctr{0}],
$$E[aX+b]=E[g(X)]=\sum_{i}g(x_{i})p(x_{i})$$\s
where $x_{i}$ are possible different values of $X$. Expand $g$ gives
$$\begin{aligned}[t]
\sum_{i}g(x_{i})p(x_{i})&=\sum_{i}(ax_{i}+b)p(x_{i})\\
&=a\sum_{i}x_{i}p(x_{i})+b\sum_{i}p(x_{i})\\
&=aE[X]+b
\end{aligned}$$
\end{crl}
\subsubsection{Variance of Discrete Random Variables}
\begin{dft}
Let $X$ be a discrete random variable, then the \textbf{variance} of $X$, denoted by $\mathrm{Var}(X)$, is defined as
$$\mathrm{Var}(X)=E[(X-\mu)^{2}]$$\s
where $\mu=E[X]$.
\end{dft}\n
Note that variance of $X$ is sometimes written as $V(X)$ for simplicity. Variance of $X$ describes how $X$ is spread out from its mean value $\mu$.\n
\begin{pst}
Let $X$ be a discrete random variable, then $\mathrm{Var}(X)=E[X^{2}]-\mu^{2}$\n
\prf Note that
$$\begin{aligned}[t]
\mathrm{Var}(X)&=E[(X-\mu)^{2}]\\
&=\sum_{i}(x_{i}-\mu)^{2}p(x_{i})\\
&=\sum_{i}(x_{i}^{2}-2\mu x_{i}+\mu^{2})p(x_{i})\\
&=\sum_{i}x_{i}^{2}p(x_{i})-2\mu\sum_{i}x_{i}p(x_{i})+\mu^{2}\sum_{i}p(x_{i})\\
&=E[X^{2}]-2\mu^{2}+\mu^{2}=E[X^{2}]-\mu^{2}
\end{aligned}$$
\end{pst}\n
\begin{crl}
Let $X$ be a discrete random variable, then $E[X^{2}]\geq(E[X])^{2}$.\n
\prf From the definition of variance, $\mathrm{Var}(X)\geq 0$, then $E[X^{2}]-\mu^{2}\geq 0$ implies the result.
\end{crl}
\subsection{Common Types of Discrete Random Variables}
\subsubsection{Bernoulli Random Variables}
Consider a random experiment where the outcomes can be classified by either a success or a failure, then the following definition applies:\n
\begin{dft}
Let $X$ be a discrete random variable where
$$X=\begin{cases}
1\erm{if the outcome is a success}\\
0\erm{if the outcome is a failure}
\end{cases}$$\s
then $X$ is called a \textbf{Bernoulli random variable} with parameter $p=P(\brc{X=1})$.
\end{dft}\n
Note that $p(0)+p(1)=1$ and $p(a)=0$ if $a$ is neither $0$ nor $1$. Since the expected values $E[X]=p$ and $E[X^{2}]=p$, then the variance $V(X)=E[X^{2}]-(E[X])^{2}=p-p^{2}$.
\subsubsection{Binomial Random Variables}
Consider a random experiment with $n$ subexperiments and each subexperiment results in either a success or a failure, then the following definition applies:\n
\begin{dft}
Let $X$ be a discrete random variable that is equal to the number of successes in a random experiment with $n$ subexperiments, then $X$ is called a \textbf{Binomial random variable} with parameters $(n,p=P(\mathrm{success}))$.
\end{dft}\n
Consider the following example:\n
\begin{exm}
For $n=2$, the possible outcomes of the experiments are $(S,S)$, $(S,F)$, $(F,S)$ and $(F,F)$ where $S$ indicates a success and $F$ indicates a failure. If the probability of a success in each subexperiment is $p$,
$$\begin{cases}
P(\brc{X=0})=P(\brc{(F,F)})=(1-p)^{2}\\
P(\brc{X=1})=P(\brc{(S,F),(F,S)})=2p(1-p)\\
P(\brc{X=2})=P(\brc{(S,S)})=p^{2}
\end{cases}$$
\end{exm}\n
\begin{pst}
Let $X$ be a binomial random variable with parameters $(n,p)$, then
$$P(\brc{X=k})=\binom{n}{k}p^{k}(1-p)^{n-k}$$\s
for $k=0,1,\cdots,n$.\n
\prf Note that for any sequence of outcomes of $n$ subexperiments in which $k$ of them results in successes, there will be $n-k$ failures, so each sequence has probability $p^{k}(1-p)^{n-k}$. By combinatorics, there are $C_{k}^{n}$ sequences that have $k$ successes. The proof is finished by multiplying the results.
\end{pst}\n
Therefore the name of Binomial random variable comes from binomial constant which is also applied to Binomial theorem
$$(x+y)^{n}=\sum_{i=0}^{n}\binom{n}{i}x^{i}y^{n-i}$$\s
\begin{pst}
Let $X$ be a binomial random variable with parameters $(n,p)$, then for $k\geq 1$,
$$E[X^{k}]=npE[(Y+1)^{k-1}]$$\s
where $Y$ is another binomial random variable with parameters $(n-1,p)$.\n
\prf By \rdft[\sctr{3}],
$$\begin{aligned}[t]
E[X^{k}]&=\sum_{i=0}^{n}i^{k}\binom{n}{i}p^{i}(1-p)^{n-i}\\
&=\sum_{i=1}^{n}i^{k}\binom{n}{i}p^{i}(1-p)^{n-i}\\
&=\sum_{i=1}^{n}i^{k-1}\binom{n-1}{i-1}p^{i}(1-p)^{n-i}\\
&=np\sum_{i=1}^{n}i^{k-1}\binom{n-1}{i-1}p^{i-1}(1-p)^{n-i}\\
&=np\sum_{j=0}^{n-1}(j+1)^{k-1}\binom{n-1}{j}p^{j}(1-p)^{(n-1)-j}\\
&=npE[(Y+1)^{k-1}]
\end{aligned}$$
\end{pst}\n
\begin{crl}
Let $X$ be a binomial random variable with parameters $(n,p)$, then $E[X]=np$, $E[X^{2}]=np((n-1)p+1)$ and $\mathrm{Var}(X)=n(p-p^{2})$.\n
\prf Note that
$$E[X]=npE[(Y+1)^{0}]=np$$\s
and
$$E[X^{2}]=npE[Y+1]=np(E[Y]+1)=np(np-p+1)$$\s
Therefore
$$\mathrm{Var}(X)=E[X^{2}]-E[X]^{2}=np(np-p+1)-(np)^{2}=n(p-p^{2})$$
\end{crl}\n
A binomial random variable $X$ with parameter $(n,p)$ can be expressed as
$$X=X_{1}+X_{2}+\cdots+X_{n}$$\s
where $X_{i}$ are independent Bernoulli random variables.
\subsubsection{Poisson Random Variables}
\begin{dft}
Let $\lambda>0$, then a \textbf{Poisson random variable} with parameter $\lambda$ is a random variable $X$ that takes nonnegative integers $i=\brc{0,1,\cdots}$ such that
$$P(\brc{X=i})=e^{-\lambda}\frac{\lambda^{i}}{i!}$$
\end{dft}\n
Poisson random variable satisfies property of probability since
$$\sum_{i=0}^{\infty}e^{-\lambda}\frac{\lambda^{i}}{i!}=e^{-\lambda}\brr{\sum_{i=0}^{\infty}\frac{\lambda^{i}}{i!}}=e^{-\lambda}e^{\lambda}=1$$\s
A Poisson random variable can be used to approximate a binomial random variable $X$ with parameters $(n,p)$ when $n$ is large and $p$ is small such that $np$ is of moderate size that can be used as $\lambda=np$:
$$\begin{aligned}[t]
P\brc{X=k}&=\binom{n}{k}p^{k}(1-p)^{n-k}\\
&=\frac{n(n-1)\cdots(n-k+1)}{k!}\brr{\frac{\lambda}{n}}^{k}\brr{1-\frac{\lambda}{n}}^{n-k}\\
&=\frac{1(1-1/n)\cdots(1-(k-1)/n)}{k!}\lambda^{k}\brr{1-\frac{\lambda}{n}}^{n-k}\\
&\approx\frac{\lambda^{k}}{k!}e^{-\lambda}
\end{aligned}$$\s
\begin{pst}
Let $X$ be a Poisson random variable with parameter $\lambda$, then $E[X]=\lambda$ and $\mathrm{Var}(X)=\lambda$.\n
\prf Note that
$$\begin{aligned}[t]
E[X]&=\sum_{k=0}^{\infty}ke^{-\lambda}\frac{\lambda^{k}}{k!}\\
&=\sum_{k=1}^{\infty}ke^{-\lambda}\frac{\lambda^{k}}{k!}\\
&=\sum_{k=1}^{\infty}e^{-\lambda}\frac{\lambda^{k}}{(k-1)!}\\
&=\lambda\sum_{k=1}^{\infty}e^{-\lambda}\frac{\lambda^{k-1}}{(k-1)!}\\
&=\lambda\sum_{j=0}^{\infty}e^{-\lambda}\frac{\lambda^{j}}{j!}=\lambda
\end{aligned}$$\s
and by using similar approach as above,
$$\begin{aligned}[t]
E[X^{2}]&=\sum_{k=0}^{\infty}k^{2}e^{-\lambda}\frac{\lambda^{k}}{k!}\\
&=\sum_{k=1}^{\infty}ke^{-\lambda}\frac{\lambda^{k}}{(k-1)!}\\
&=\sum_{k=1}^{\infty}(k-1)e^{-\lambda}\frac{\lambda^{k}}{(k-1)!}+\sum_{k=1}^{\infty}e^{-\lambda}\frac{\lambda^{k}}{(k-1)!}\\
&=\lambda^{2}+\lambda
\end{aligned}$$\s
Therefore $\mathrm{Var}(X)=E[X^{2}]-E[X]^{2}=\lambda$.
\end{pst}
\subsection{Properties of Expected Values}
\subsubsection{Expectation of Sums of Discrete Random Variables}
\begin{pst}
Let $S$ be a finite or countably infinite sample space, and $p(s)=P(\brc{S})$ for any $s\in S$, then for any random variable $X$ on $S$,
$$E[X]=\sum_{s\in S}X(s)P(s)$$\s
\prf Suppose the distinct values of $X$ are $x_{i}$ and $S_{i}=\brc{s\in S\srm X(s)=x_{i}}$, then
$$\begin{aligned}[t]
E[X]&=\sum_{i}x_{i}P(\brc{X=x_{i}})\\
&=\sum_{i}x_{i}P(S_{i})\\
&=\sum_{i}x_{i}\sum_{s\in S_{i}}p(s)\\
&=\sum_{i}\sum_{s\in S_{i}}X(s)p(s)\\
&=\sum_{s\in S}X(s)P(s)
\end{aligned}$$
\end{pst}\n
\begin{pst}
Let $X_{1},X_{2},\cdots,X_{n}$ be discrete random variables on a finite or countably finite sample space $S$, then
$$E[X_{1}+X_{2}+\cdots+X_{n}]=\sum_{k=1}^{n}E[X_{k}]$$\s
\prf By \rpst[\sctr{1}],
$$\begin{aligned}[t]
E[X_{1}+X_{2}+\cdots+X_{n}]&=\sum_{s\in S}(X_{1}(s)+X_{2}(s)+\cdots+X_{n}(s))p(s)\\
&=\sum_{k=1}^{n}\brr{\sum_{s\in S}x_{k}(s)p(s)}\\
&=\sum_{k=1}^{n}E[X_{k}]
\end{aligned}$$
\end{pst}\n
\subsubsection{Continuity of Probability}
\begin{dft}
Let $M$ be a collection of sets and $E_{n}\in M$ for all $n$, then $M$ is said to be \textbf{closed under countable increasing unions}, denoted by $E_{n}\nearrow E$, if
$$E_{n+1}\supset E_{n},\;E=\bigcup_{n=1}^{\infty}E_{n}$$\s
Similarly, $M$ is said to be \textbf{closed under contable decreasing intersections}, denoted by $E_{n}\searrow E$, if
$$E_{n+1}\subset E_{n},\;E=\bigcap_{n=1}^{\infty}E_{n}$$
\end{dft}\n
With the defintion above, below is the continuity property of probability:\n
\begin{pst}
Let $M$ be a collection of sets and $E_{n}\in M$ for all $n$, then if $E_{n}\nearrow E$ or $E_{n}\searrow E$, $\lim P(E_{n})=P(E)$.
\end{pst}
\subsubsection{Cumulative Distribution Function}
\begin{dft}
Let $X$ be a random variable on a sample space $S$, then the \textbf{cumulative distribution function} of $X$, denoted by $F$, is a function that maps from $\R$ to $\R$ such that
$$F(b)=P(\brc{X\leq b})$$
\end{dft}\n
\begin{pst}
A cumulative distribution function $F$ has the following properties:
\begin{alist}
\item $F$ is a nondecreasing function. In other words, for $a<b$, $F(a)\leq F(b)$.
\item When $b$ tends to $+\infty$ and $-\infty$ respectively,
$$\lim_{b\to+\infty}F(b)=1,\;\lim_{b\to-\infty}F(b)=0$$
\item $F$ is right continuous. In other words,
$$\lim_{b_{n}\to b+}F(b_{n})=F(b)$$
\end{alist}
\prf\prt[a]{zr} If $a<b$, then $\brc{X\leq a}\subset\brc{X\leq b}$, so $F(a)\leq F(b)$.\n
\prtc[b]{zr} If $b_{n}\nearrow\infty$, then
$$\brc{X\leq b_{n}}\nearrow\brc{X<\infty}=S$$\s
so $F(b_{n})\to 1$ by \rpst[\sctr{2}]. Similarly, if $b_{n}\searrow-\infty$, then
$$\brc{X\leq b_{n}}\searrow\brc{X=-\infty}=\phi$$\s
so $F(b_{n})\to 0$ by \rpst[\sctr{2}].\n
\prtc[c]{zr} If $b_{n}\searrow b$, then
$$\brc{X\leq b_{n}}\searrow\brc{X\leq b}$$\s
so $F(b_{n})\to F(b)$ by \rpst[\sctr{2}] and shows that $F$ is right continuous.
\end{pst}\n
Note that $F$ is not left continuous. In the discrete case,
$$P(\brc{X=b})=F(b)-\lim_{b_{n}\nearrow b}F(b_{n})=F(b)-F(b-)$$\s
That is, if $b_{n}\nearrow b$, then
$$\brc{X\leq b_{n}}\nearrow\brc{X\leq b}$$\s
so
$$P(\brc{X=b})=P(\brc{X\leq b})-P(\brc{X<b})$$
\subsection{Continuous Random Variables}
\subsubsection{Definition of Continuous Random Variables}
\begin{dft}
Let $f$ be a nonnegative function defined on $(-\infty,\infty)$, then $X$ is called a \textbf{continuous random variable} if
$$P(\brc{X\in B})=\int_{B}f(x)\diff x$$\s
for all measurable sets $B\subset(-\infty,\infty)$.
\end{dft}\n
By measurable sets, it represents all intervals and countable unions or intersections of intervals. Note that
$$P(\brc{a\leq X\leq b})=\int_{a}^{b}f(x)\diff x$$\s
which is the area of shaded region under $f(x)$.\n
\begin{dft}
Let $f$ be a nonnegative function defined on $(-\infty,\infty)$ and $X$ is a continuous random variable, then $f$ is called a \textbf{probability density function} of $X$ if
$$\int_{-\infty}^{\infty}f(x)\diff x=1$$
\end{dft}\n
\begin{exm}
Let $X$ be a continuous random variable with probability density function
$$f(x)=\begin{cases}
C(4x-2x^2)\erm{if }x\in(0,2)\\
0\erm{otherwise}
\end{cases}$$\s
Find the value of $C$, and $P(\brc{X\geq 1})$.\n
\ans By \rdft[\sctr{1}],
$$\begin{aligned}[t]
\int_{-\infty}^{\infty}f(x)\diff x&=1\\
\int_{0}^{2}C(4x-2x^{2})&=1\\
C\brs{2x^{2}-\frac{2}{3}x^{3}}_{0}^{2}&=1\\
\frac{8}{3}C&=1\\
C&=\frac{3}{8}