> For the complete documentation index, see [llms.txt](https://kmis.gitbook.io/statistics/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kmis.gitbook.io/statistics/chapter-3.-basic-concepts-of-probability/3-1.-sample-spaces-events-and-their-probabilities.md).

# 3-1. Sample Spaces, Events, and Their Probabilities

样本空间和事件和概率

1. 样本空间和事件 (概率论)\
   \- 文氏图(Venn Diagram)\
   \- 树形图（Tree Diagram）
2. 概率（Probability）

{% file src="/files/-LyWTLP7PzFLNpwFLD0\_" %}
Chapter 3 (Korean)
{% endfile %}

{% file src="/files/-Lz9wiAjWejX6WZPOQfn" %}
Chapter 3 (Chinese)
{% endfile %}

{% file src="/files/-LyCR-icv8mB7ehEUWKu" %}
Examples of Chapter 3 (R Source files)
{% endfile %}

{% file src="/files/-Lr2TUxRnkkyFlubJr3C" %}
Probability
{% endfile %}

## 1. Sample Spaces and Events

> *A* **random experiment** *is a mechanism that produces a definite outcome that cannot be predicted with certainty. The* **sample space** *associated with a random experiment is the set of all possible outcomes. An* **event** *is a subset of the sample space.*

> *An event* *E* *is said to* **occur** *on a particular trial of the experiment if the outcome observed is an element of the set* *E*.

**EXAMPLE 1.** Construct a **sample space** for the experiment that consists of tossing a single coin.

**\[ Solution ]**    $$S = { H, T }$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
# install.packages("prob")
library(prob)

tosscoin(1)
```

{% endtab %}

{% tab title="Sample Space" %}

```
> tosscoin(1)
##   toss1
## 1     H
## 2     T
```

{% endtab %}
{% endtabs %}

**EXAMPLE 2.** Construct a **sample space** for the experiment that consists of rolling a single die. Find the **events** that correspond to the phrases “an even number is rolled” and “a number greater than two is rolled.”

**\[ Solution ]**    $$S = { 1, 2, 3, 4, 5, 6 }$$ , $$E\_1 = { 2, 4, 6}$$ ,  $$E\_2 = { 3, 4, 5, 6 }$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
library(prob)

## 1. Sample Space : rolling a single die
rolldie(1)

# 2. Event 1 : an even number is rolled
S <- rolldie(1)
E1 <- subset(S, X1 %% 2 ==0); E1

# 3. Event 2 : a number greater than two is rolled.
S <- rolldie(1)
E2 <- subset(S, X1 > 2); E2
```

{% endtab %}

{% tab title="# 1. Sample Space : S" %}

```
> # 1. Sample Space : rolling a single die
> rolldie(1)
##   X1
## 1  1
## 2  2
## 3  3
## 4  4
## 5  5
## 6  6
## 
```

{% endtab %}

{% tab title="# 2. Event 1" %}

```
> # 2. Event1 : an even number is rolled
> S <- rolldie(1)
> E1 <- subset(S, X1 %% 2 ==0); E1
##   X1
## 2  2
## 4  4
## 6  6

```

{% endtab %}

{% tab title="# 3. Event 2" %}

```
> # 3. Event 2 : a number greater than two is rolled.
> S <- rolldie(1)
> E2 <- subset(S, X1 > 2); E2
##   X1
## 3  3
## 4  4
## 5  5
## 6  6

```

{% endtab %}
{% endtabs %}

### 1-1. Venn Diagram

&#x20;A graphical representation of a sample space and events is a **Venn diagram**

![Venn Diagram for Two Sample Spaces](https://saylordotorg.github.io/text_introductory-statistics/section_07/97b468eaa2da56c52e300c556c23a24f.jpg)

**EXAMPLE 3.** A random experiment consists of **tossing two coins**.

1. Construct a sample space for the situation that the coins are indistinguishable, such as two brand new pennies.
2. Construct a sample space for the situation that the coins are distinguishable, such as one a penny and the other a nickel.

**\[ Solution ]**  &#x20;

1. two same coins : two head -> 2h, two tails -> 2t, 2 different faces : d =>$$S = { 2h, 2t, d }$$&#x20;
2. two different coins (penny, nickel) :  $$S = { hh, th, ht, tt}$$

### 1-2. Venn Diagram Plot in R

* type of count data.

```
A   450
B   1800
A and B both    230
```

I want to develop a colorful (possibly semi-transparency at intersections) like the following Venn diagram.

{% tabs %}
{% tab title="R Source" %}

```
require(venneuler)
v <- venneuler(c(A=450, B=1800, "A&B"=230))
plot(v)
```

{% endtab %}

{% tab title="Venn Diagram" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxlBHG7EFciVJ0IDWX%2F-LqxlCjTQeB0CRJWSk9m%2Fimage.png?alt=media\&token=1714d448-4b9f-4e72-986f-cb4f4604d65a)
{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="R Source" %}

```
# install package
if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("VennDiagram")
library("VennDiagram")

# 2-set diagram
venn.plot <- draw.pairwise.venn(30, 20, 10, c("A-up", "B-up"), scaled = FALSE);

venn.plot <- draw.triple.venn(
  area1 = 60,
  area2 = 70,
  area3 = 80,
  n12 = 30,
  n23 = 20,
  n13 = 10,
  n123 = 5,
  category = c("A_up-regulation", "B_up-regulation", "C_up-  regulation"),
);

# 3-set diagram
venn.plot <- draw.triple.venn(
  area1 = 60,
  area2 = 70,
  area3 = 80,
  n12 = 30,
  n23 = 20,
  n13 = 10,
  n123 = 5,
  category = c("A_up-regulation", "B_up-regulation", "C_up-  regulation"),
);

# 4-set diagram
venn.plot <- draw.quad.venn(
  area1 = 90,
  area2 = 80,
  area3 = 75,
  area4 = 49,
  n12 = 37,
  n13 = 25,
  n14 = 26,
  n23 = 34,
  n24 = 30,
  n34 = 22,
  n123 = 16,
  n124 = 15,
  n134 = 10,
  n234 = 12,
  n1234 = 3,
  category = c("First", "Second", "Third", "Fourth"),
  fill = c("orange", "red", "green", "blue"),
  lty = "dashed",
  cex = 2,
  cat.cex=2,
  cat.col = c("orange", "red", "green", "blue")
);
```

{% endtab %}

{% tab title="2-Set Diagram" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-Lqxn1CLsyvxr5sebG3S%2F-LqxnS4zjKwyWJZfIFBH%2Fimage.png?alt=media\&token=95e314b0-1819-411f-9fc9-d861a0cb7a9c)
{% endtab %}

{% tab title="3-Set Diagram" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-Lqxn1CLsyvxr5sebG3S%2F-LqxnhABANKtjQJVEGGm%2Fimage.png?alt=media\&token=6d6c48e8-ab01-48e7-b31d-4c2bce771753)
{% endtab %}

{% tab title="4-set Diagram" %}
![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxnuBMT1fP-UAzo5mt%2F-LqxnwsaZ77mPpcO2v7S%2Fimage.png?alt=media\&token=dc783fd7-b4b7-491f-bd33-f5f368ee10fe)
{% endtab %}
{% endtabs %}

\[ 참고자료 - [Venn Diagram](http://www.incodom.kr/R_%28%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D_%EC%96%B8%EC%96%B4%29/VennDiagram) ]

### 1-3. tree diagram

> A device that can be helpful in identifying all possible outcomes of a random experiment, particularly one that can be viewed as proceeding in stages, is what is called a **tree diagram**.

**EXAMPLE 4.** Construct a sample space that describes all three-child families according to the genders of the children with respect to birth order.

**\[ Solution ]** $$S = { bbb, bbg, bgb, bgg, gbb, gbg, ggb, ggg }$$ , g=girl ; b=boy

![](https://saylordotorg.github.io/text_introductory-statistics/section_07/e9de1d9b1c09ed5a0870567d7e5ad809.jpg)

> The line segments are called **branches** of the tree. The right ending point of each branch is called a **node**. The nodes on the extreme right are the **final nodes**; to each one there corresponds an outcome, as shown in the figure.

### **1-4. Tree Diagram in R**

* [fancyRpartPlot in R](http://www.dodomira.com/2016/07/19/r-%EC%9D%98%EC%82%AC%EA%B2%B0%EC%A0%95%EB%82%98%EB%AC%B4-%EA%B9%94%EB%81%94%ED%95%98%EA%B2%8C-plotting-%ED%95%98%EA%B8%B0-fancyrpartplot-r/)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-LqxrW9EK0k7BwFUfVHu%2Fimage.png?alt=media\&token=d1a4385a-3c32-451d-a8e7-1cd2dec55a21)

* [How to create a massive tree diagram in RStudio?](https://stackoverflow.com/questions/36206299/how-to-create-a-massive-tree-diagram-in-rstudio)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-LqxrbP9X894KT0I4XVR%2Fimage.png?alt=media\&token=4852bb71-6e7c-4041-a461-f1fa10ff961f)

* [Introduction to data.tree](https://cran.r-project.org/web/packages/data.tree/vignettes/data.tree.html)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-Lqxs3CJSslqoh-ueKJm%2Fimage.png?alt=media\&token=f4b48641-1be1-4345-a0c2-3b802a44abbe)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-LqxrpxmoP79cGYHBYsk%2Fimage.png?alt=media\&token=64af7abb-3b2d-408a-9aba-2a52b8cbcaae)

* [PROBABILITY TREE DIAGRAMS IN R](http://www.harrysurden.com/wordpress/archives/292)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-Lqxs7W5GJyr4jTYplxV%2Fimage.png?alt=media\&token=5a434f39-1fda-4c2f-acf4-9ed5dd74539b)

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxqAak4i7aLp6yzaay%2F-LqxsBFS8N7RwUci2ZcV%2Fimage.png?alt=media\&token=ba0f8c62-c7f1-4360-a5ff-b9e6bf34a834)

* [venn.diagram](https://www.rdocumentation.org/packages/VennDiagram/versions/1.6.20/topics/venn.diagram) From [VennDiagram v1.6.20](https://www.rdocumentation.org/packages/VennDiagram/versions/1.6.20) by [Paul Boutros](https://www.rdocumentation.org/collaborators/name/Paul%20Boutros)<br>

## 2. Probability

> *The* **probability of an outcome** ***e*** *in a sample space* *S* *is a number* *p* *between 0 and 1 that measures the likelihood that* *e* *will occur on a single trial of the corresponding random experiment. The value* $$p = 0$$ *corresponds to the outcome* *e* *being impossible and the value* $$p = 1$$ *corresponds to the outcome* *e* *being certain.*

> *The* **probability of an event** *A* *is the sum of the probabilities of the individual outcomes of which it is composed. It is denoted*  $$p(A)$$.<br>

> If an event $$E$$ is $$E = {e\_1, e\_2,  ..., e\_k }$$, then  &#x20;
>
> &#x20;                                        $$P(E)=P(e\_1)+P(e\_2)+ ⋅ ⋅ ⋅ +P(e\_k)$$ <br>

![Sample Space and Probability](https://saylordotorg.github.io/text_introductory-statistics/section_07/b1371037e2e863e76e91bc00adf37f63.jpg)

**EXAMPLE 5.** A coin is called “balanced” or “fair” if each side is equally likely to land up. Assign a probability to each outcome in the sample space for the experiment that consists of tossing a single fair coin.

**\[ Solution ]** $$S = { H, T }$$ ,         $$P(H) = P(T) =1/2$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
# install.packages("prob")
library(prob)

tosscoin(1, makespace = TRUE)
```

{% endtab %}

{% tab title="Sample Space & Probability" %}

```
> tosscoin(1, makespace = TRUE)
##   toss1 probs
## 1     H   0.5
## 2     T   0.5
```

{% endtab %}
{% endtabs %}

**EXAMPLE 6.** A die is called “balanced” or “fair” if each side is equally likely to land on top. Assign a probability to each outcome in the sample space for the experiment that consists of tossing a single fair die. Find the probabilities of the events $$E$$ : “an even number is rolled” and $$T$$ : “a number greater than two is rolled.”

**\[ Solution ]**  $$S = { 1, 2, 3, 4, 5, 6 }$$

1. $$E = { 2, 4, 6}$$ ,  $$P(E) = 3 / 6 = 1/2$$&#x20;
2. $$T = {3, 4, 5, 6 }$$ , $$P(T) = 4/6 = 2/3$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
library(prob)

# 1. Sample Space
S <- rolldie(1, makespace = TRUE); S

# 2. P(E)
E <- subset(S, X1 %% 2 == 0); E
Prob(S, X1 %% 2 == 0)    # or Prob(E)

# 3. P(T)
T <- subset(S, X1 > 2); T
Prob(S, X1 > 2)          # or Prob(T)
```

{% endtab %}

{% tab title="1. Sample Space" %}

```
> # 1. Sample Space
> S <- rolldie(1, makespace = TRUE); S
##   X1     probs
## 1  1 0.1666667
## 2  2 0.1666667
## 3  3 0.1666667
## 4  4 0.1666667
## 5  5 0.1666667
## 6  6 0.1666667
```

{% endtab %}

{% tab title="2. P(E)" %}

```
> # 2. P(E)
> E <- subset(S, X1 %% 2 == 0); E
##   X1     probs
## 2  2 0.1666667
## 4  4 0.1666667
## 6  6 0.1666667
> Prob(S, X1 %% 2 == 0)    # or Prob(E)
## [1] 0.5
```

{% endtab %}

{% tab title="3. P(T)" %}

```
> # 3. P(T)
> T <- subset(S, X1 > 2); T
##   X1     probs
## 3  3 0.1666667
## 4  4 0.1666667
## 5  5 0.1666667
## 6  6 0.1666667
> Prob(S, X1 > 2)          # or Prob(T)
## [1] 0.6666667
```

{% endtab %}
{% endtabs %}

**EXAMPLE 7.** Two fair coins are tossed. Find the probability that the coins match, i.e., either both land heads or both land tails.

**\[ Solution ]**

1. identical coins **:** $$S = { 2h, 2t, d }$$ , $$E = {2h, 2t }$$ =>  $$P(E)   = 2/3$$&#x20;
2. two different coins : $$S^t = { 2h, ht, th, 2t  }$$ , $$E^t = {2h, 2t }$$ => $$P(E^t) = 2/4 = 1/2$$&#x20;

**\[ Solution 1 ]**

{% tabs %}
{% tab title="R Source" %}

```
library(prob)

a <- tosscoin(2, makespace = TRUE); a

S1 <- subset(a, toss1 == toss2); S1
S2 <- subset(a, toss1 != toss2); S2

S2[,1] <- "D" ; S2
S2[,2] <- "D" ; S2

# 1) Sample Space
S <- union(S1, S2)
S$probs <- 1/3; S

# 2) Probability that the coins match..
Prob(S, toss1 == "H" | toss2 =="T")
```

{% endtab %}

{% tab title="Subset" %}

```
> a <- tosscoin(2, makespace = TRUE); a
##   toss1 toss2 probs
## 1     H     H  0.25
## 2     T     H  0.25
## 3     H     T  0.25
## 4     T     T  0.25
> 
> S1 <- subset(a, toss1 == toss2); S1
##   toss1 toss2 probs
## 1     H     H  0.25
## 4     T     T  0.25
> S2 <- subset(a, toss1 != toss2); S2
##   toss1 toss2 probs
## 2     T     H  0.25
## 3     H     T  0.25
>
> S2[,1] <- "D" ; S2
##   toss1 toss2 probs
## 2     D     H  0.25
## 3     D     T  0.25
> S2[,2] <- "D" ; S2
##   toss1 toss2 probs
## 2     D     D  0.25
## 3     D     D  0.25

```

{% endtab %}

{% tab title="1) Sample Space" %}

```
> # 1) Sample Space
> S <- union(S1, S2); S
##   toss1 toss2 probs
## 1     H     H  0.25
## 2     D     D  0.25
## 4     T     T  0.25
> 
> S$probs <- 1/3; S
##   toss1 toss2     probs
## 1     H     H 0.3333333
## 2     D     D 0.3333333
## 4     T     T 0.3333333
> Prob(S, toss1 == "H" | toss2 =="T")
## [1] 0.6666667
```

{% endtab %}

{% tab title="2) Probability" %}

```
> # 2) Probability that the coins match..
> Prob(a, toss1 != toss2)
## [1] 0.5
```

{% endtab %}
{% endtabs %}

**\[ Solution 2 ]**

{% tabs %}
{% tab title="R Source" %}

```
library(prob)

# 1. Sample Space
S <- tosscoin(2, makespace = TRUE); S

# 2. P(E)
Prob(S, toss1 == toss2)
```

{% endtab %}

{% tab title="Sample Space" %}

```
> # 1. Sample Space
> S <- tosscoin(2, makespace = TRUE); S
##   toss1 toss2 probs
## 1     H     H  0.25
## 2     T     H  0.25
## 3     H     T  0.25
## 4     T     T  0.25
```

{% endtab %}

{% tab title="Probability" %}

```
> # 2. P(E)
> Prob(S, toss1 == toss2)
## [1] 0.5
```

{% endtab %}
{% endtabs %}

**EXAMPLE 8.** The breakdown of the student body in a local high school according to race and ethnicity is 51% white, 27% black, 11% Hispanic, 6% Asian, and 5% for all others. A student is randomly selected from this high school. (To select “randomly” means that every student has the same chance of being selected.) Find the probabilities of the following events:

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-LqxwsNwcVj7b-Ht2hMV%2F-LqxwuIc64-bmqff_VS-%2Fimage.png?alt=media\&token=4821468e-9e82-4a96-bf08-8513be0f8079)

1. $$B$$ : the student is black,
2. $$M$$ : the student is minority (that is, not white),
3. $$N$$ : the student is not black.

**\[ Solution ]**

1. $$P(B) = P(b) = 0.27$$&#x20;
2. $$P(M) = 1 - P(w) = 1 - 0.51 = 0.49$$&#x20;
3. $$P(N) = 1 - P(b) = 1-0.27 = 0.73$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
library(prob)

X1 <- c("w", "b", "h", "a", "o")
probs <- c(0.51, 0.27, 0.11, 0.06, 0.05)

# 1. Sample Space
S <- data.frame(X1, probs)

# 2. P(B)
Prob(S, X1 == "b")

# 3. P(M) = 1 - P(w)
1 - Prob(S, X1 == "w")

# 4. P(N) = 1 - P(b)
1 - Prob(S, X1 == "b")
```

{% endtab %}

{% tab title="Sample Space" %}

```
> # 1. Sample Space
> S <- data.frame(X1, probs); S
##   X1 probs
## 1  w  0.51
## 2  b  0.27
## 3  h  0.11
## 4  a  0.06
## 5  o  0.05
##
```

{% endtab %}

{% tab title="P(B)" %}

```
> # 2. P(B)
> Prob(S, X1 == "b")
## [1] 0.27
```

{% endtab %}

{% tab title="P(M)" %}

```
> # 3. P(M) = 1 - P(w)
> 1 - Prob(S, X1 == "w")
## [1] 0.49
```

{% endtab %}

{% tab title="P(N)" %}

```
> # 4. P(N) = 1 - P(b)
> 1 - Prob(S, X1 == "b")
## [1] 0.73
```

{% endtab %}
{% endtabs %}

**EXAMPLE 9.** The student body in the high school considered in "**Example 8**" may be broken down into ten categories as follows: 25% white male, 26% white female, 12% black male, 15% black female, 6% Hispanic male, 5% Hispanic female, 3% Asian male, 3% Asian female, 1% male of other minorities combined, and 4% female of other minorities combined. A student is randomly selected from this high school. Find the probabilities of the following events:

![](https://2234305379-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lqmt1Wp54aKlZ5eVcaS%2F-Lqxy1aYxXGTAdPg0_yN%2F-Lqxy32k5tpogwanmWTZ%2Fimage.png?alt=media\&token=2a901408-ef7b-4a8d-b1dc-87faec27f12e)

1. $$B$$ : the student is black,
2. $$MF$$ : the student is minority female,
3. $$FN$$ : the student is female and is not black.

**\[ Solution ]**

1. $$P(B) = P(bm) + P(bf) = 0.12 + 0.15 = 0.27$$&#x20;
2. $$P(MF) = P(bf) + P(hf) + P(af) + P(of)  = 0.15 +0.05+0.03+0.04=0.27$$&#x20;
3. $$P(FN) = P(wf) + P(hf) + P(af) + P(of) = 0.26 +0.05+0.03+0.04 = 0.38$$&#x20;

{% tabs %}
{% tab title="R Source" %}

```
sex <- c("Male", "Female")
race <- c("w", "b", "h", "a", "o")
probs <- c(0.25, 0.12, 0.06, 0.03, 0.01, 0.26, 0.15, 0.05, 0.03, 0.04)
prob <- matrix( probs, ncol=5, byrow=TRUE)

rownames(prob) <- sex
colnames(prob) <- race
Prob <- as.table(prob); Prob

addmargins(Prob)

# 1. P(B)
sum(Prob[,"b"])

# 2. P(MF) = P(F) - P(wf)
sum(Prob["Female",]) - Prob["Female", "w"]

# 3. P(FN) = P(F) - P(bf)
sum(Prob["Female",]) - Prob["Female", "b"]

```

{% endtab %}

{% tab title="Prob. Table" %}

```
> Prob <- as.table(prob); Prob
##           w    b    h    a    o
## Male   0.25 0.12 0.06 0.03 0.01
## Female 0.26 0.15 0.05 0.03 0.04
> 
> addmargins(Prob)
##           w    b    h    a    o  Sum
## Male   0.25 0.12 0.06 0.03 0.01 0.47
## Female 0.26 0.15 0.05 0.03 0.04 0.53
## Sum    0.51 0.27 0.11 0.06 0.05 1.00
```

{% endtab %}

{% tab title="P(B)" %}

```
> sum(Prob[,"b"])
## [1] 0.27
```

{% endtab %}

{% tab title="P(MF)" %}

```
> sum(Prob["Female",]) - Prob["Female", "w"]
## [1] 0.27
```

{% endtab %}

{% tab title="P(FN)" %}

```
> sum(Prob["Female",]) - Prob["Female", "b"]
## [1] 0.38
```

{% endtab %}
{% endtabs %}

1. 样本空间和事件 (概率论)\
   \- 文氏图(Venn Diagram)\
   \- 树形图（Tree Diagram）
2. 概率（Probability）
