> ## Documentation Index
> Fetch the complete documentation index at: https://v1-learn.neoartd.my.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Sample Spaces and Probability

A `probability experiment` is a process that leads to well-defined results called outcomes.

> `percobaan probabilitas` adalah proses yang menghasilkan hasil yang terdefinisi dengan baik yang disebut sebagai `outcome`.

An `outcome` is the result of a single trial of a probability experiment.

> `outcome` adalah hasil dari satu percobaan probabilitas.

<Tip>
  A tree diagram can be used as a systematic way to find all possible outcomes of a probability experiment.

  Diagram pohon dapat digunakan sebagai cara sistematis untuk menemukan semua hasil yang mungkin dari suatu percobaan probabilitas.
</Tip>

## Tree Diagram for Tossing Two Coins

![Tree Diagram for Tossing Two Coins](https://i.ibb.co/nDNpgLj/Screenshot-2024-05-01-160016.png)

### Sample Spaces - Examples

| Experiment                   | Sample Space     |
| ---------------------------- | ---------------- |
| Toss one coin                | H, T             |
| Roll a die                   | 1, 2, 3, 4, 5, 6 |
| Answer a true-false question | True, False      |
| Toss two coins               | HH, HT, TH, TT   |

## Formula for Classical Probability

Classical probability assumes that all outcomes in the sample space are equally likely to occur.

> Probabilitas klasik mengasumsikan bahwa semua hasil dalam ruang sampel memiliki kemungkinan yang sama untuk terjadi.

That is, `equally likely` events are events that have the same probability of occurring.

> Artinya, `kejadian yang sama kemungkinannya` adalah kejadian yang memiliki probabilitas yang sama untuk terjadi.

<Card>
  The probability of any event $E$ is

  <br />

  $\dfrac{\text{number of outcomes in E}}{\text{total number of outcomes in the sample space}}$

  <br />

  This probability is denoted by

  $~~~~~~~~~~ P(E) = \dfrac{n(E)}{n(S)} $

  This probability is called `classical probability`, and it uses the sample space $S$
</Card>

### Classical Probability - Examples

<Card>
  For a card drawn from an ordinary deck, find the probability of getting (a) a queen (b) a 6 of clubs (c) a 3 or a diamond.

  <br />

  Solution:

  (a) Since there are 4 queens and 52 cards, $ P(queen) = \dfrac{4}{52} = \dfrac{1}{13}$

  <br />

  (b) Since there is only one 6 of clubs, then, $ P(6~of~clubs) = \dfrac{1} {52}$

  <br />

  (c) There are four 3s and 13 diamonds, but the 3 of diamonds is counted twice in
  the listing. Hence there are only 16 possibilities of drawing a 3 or a diamond,
  thus $ P(3~or~diamond) = \dfrac{16} {52} = \dfrac{4} {13}$
</Card>

<Card>
  When a single die is rolled, find the probability of getting a 9.

  <br />

  Solution:

  Since the sample space is 1, 2, 3, 4, 5, and 6, it is impossible to get a 9. Hence, $ P(9) = \dfrac{0}{6} = 0$

  <Tip>
    The sum of the probabilities of all outcomes in a sample space is one.
  </Tip>
</Card>

## Complement of an Event

The complement of an event *E* is the set of outcomes in the sample space that are not included in the outcomes of event *E*. The complement of *E* is denoted by $\overline{E}$ (E bar).

![Complement of an Event](https://i.ibb.co/V3WdZF9/Screenshot-2024-05-01-162032.png)

### Complement of an Event - Examples

<Card>
  Find the complement of each event.

  <Accordion title="Rolling a die and getting a 4">
    Solution: Getting a 1, 2, 3, 5, or 6.
  </Accordion>

  <Accordion title="Selecting a letter of the alphabet and getting a vowel">
    Solution: Getting a consonant (assume y is a consonant).
  </Accordion>

  <Accordion title="Selecting a day of the week and getting a weekday">
    Solution: Getting Saturday or Sunday.
  </Accordion>

  <Accordion title="Selecting a one-child family and getting a boy">
    Solution: Getting a girl.
  </Accordion>
</Card>

### Rule for Complementary Event

<Card>
  $P(\overline{E}) = 1 - P(E)$, or

  <br />

  $P(E) = 1 - P(\overline{E})$, or

  <br />

  $P(E) + P(\overline{E}) = 1$
</Card>

## Empirical Probability

The difference between classical and `empirical probability` is that classical probability assumes that certain outcomes are equally likely while empirical probability relies on actual experience to determine the probability of an outcome.

> Perbedaan antara probabilitas klasik dan `probabilitas empiris` adalah bahwa probabilitas klasik mengasumsikan bahwa hasil tertentu sama kemungkinannya sementara probabilitas empiris bergantung pada pengalaman nyata untuk menentukan probabilitas suatu hasil.

### Formula for Empirical Probability

<Card>
  Given a frequency distribution the probability of an event being in a given class is

  <br />

  $P(E) = \dfrac{\text{frequency for the class}}{\text{total frequencies in the distribution}}$

  <br />

  $ ~~~~~~~~~~= \dfrac{f}{n}$.

  <br />

  This probability is called the empirical probability and is based on observation.
</Card>

### Empirical Probability - Example

<Card>
  In a sample of 50 people, 21 had type O blood, 22 had type A blood, 5 had type B blood, and 2 had AB blood. Set up a frequency distribution.

  | Blood Type | Frequency |
  | :--------: | :-------: |
  |      O     |     21    |
  |      A     |     22    |
  |      B     |     5     |
  |     AB     |     2     |
  |            |  50 = $n$ |

  <br />

  Find the following probabilities for the previous example.

  <Accordion title="A person has type O blood.">
    $P(O) = \dfrac{21}{50}.$
  </Accordion>

  <Accordion title="A person has type A or type B blood.">
    $P(A~or~B) = \dfrac{22}{50} + \dfrac{5}{50} = \dfrac{27}{50}.$
  </Accordion>
</Card>
