> ## 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.

# Discrete Probability

## Finite Probability

An **experiment** is a procedure that yields one of a given set of possible outcomes.

> **Eksperimen** adalah prosedur yang menghasilkan salah satu dari kumpulan kemungkinan hasil yang diberikan.

The **sample space** of the experiment is the set of possible outcomes.

> **Ruang sampel** dari eksperimen adalah kumpulan hasil yang mungkin.

An **event** is a subset of the sample space.

> **Peristiwa** adalah subset dari ruang sampel.

<Card>
  **Definition:**

  <Tip>
    If **S** is a finite nonempty sample space of equally likely outcomes,
    and **E** is an event, that is, a subset of **S**, then the *probability* of **E** is
    $P(E) = \frac{|E|}{|S|}$.

    <br />

    According to Laplace's definition, the probability of an event is
    between 0 and 1.
  </Tip>
</Card>

### Example

<Card>
  $1.$ An urn contains four blue balls and five red balls. What is the probability that a ball chosen at random from the urn is blue?

  **Solution:**

  <Check>
    To calculate the probability, note that there are nine possible outcomes, and four of these possible outcomes produce a blue ball.

    <br />

    Hence, the probability that a blue ball is chosen is $\dfrac{4}{9}$.

    <br />
  </Check>
</Card>

<Card>
  $2.$ What is the probability that when two dice are rolled, the sum of the numbers on the two dice is 7?

  **Solution:**

  <Check>
    There are a total of 36 equally likely possible outcomes when two dice are rolled.

    <br />

    There are six successful outcomes, namely, $(1, 6), (2, 5), (3, 4), (4, 3), (5, 2)$, and $(6, 1)$, where the values of the first and second dice are represented by an ordered pair.

    <br />

    Hence, the probability that a seven comes up when two fair dice are rolled is $\dfrac{6}{36} = \dfrac{1}{6}$.

    <br />
  </Check>
</Card>

<Card>
  $3.$ Find the probability that a hand of five cards in poker contains four cards of one kind.

  **Solution:**

  <Check>
    By the product rule, the number of hands of five cards with four cards of one kind is the product of the number of ways to pick one kind, the number of ways to pick the four of this kind out of the four in the deck of this kind, and the number of ways to pick the fifth card.

    <br />

    $~~~~~~~~~~ C(13,1)~C(4,4)~C(48,1)$.

    <br />

    There are C(52, 5) different hands of five cards. Hence, the probability that a hand contains four cards of one kind is

    <br />

    $~~~~~~~~~~ \dfrac{C(13,1)~C(4,4)~C(48,1)}{C(52, 5)} = \dfrac{13 \times 1 \times 48}{2,598,960} \approx 0.00024$.

    <br />
  </Check>
</Card>

## Probabilities of Complements

<Card>
  **Theorem:**

  <Tip>
    Let $E$ be an event in a sample space $S$. The probability of the event $E = S - E$, the complementary event of $E$, is given by

    <br />

    $~~~~~~~~~~ p(\bar E) = 1 - p(E)$.

    <br />
  </Tip>
</Card>

### Example

<Card>
  A sequence of 10 bits is randomly generated. What is the probability that at least one of these bits is 0?

  **Solution:**

  <Check>
    Let $E$ be the event that at least one of the 10 bits is 0.

    <br />

    Then $\bar E$ is the event that all the bits are 1s.

    <br />

    Because the sample space $S$ is the set of all bit strings of length 10, it follows that

    <br />

    $~~~~~~~~~~ p(E) = 1 - p(\bar E) = 1 - \dfrac{|S - \bar E|}{|S|} = 1 - \dfrac{1}{2^{10}}$

    <br />

    $~~~~~~~~~~~~~~~~~~~ = 1 - \dfrac{1}{1024} = \dfrac{1023}{1024}$.

    <br />
  </Check>
</Card>

## Unions of Events

<Card>
  **Theorem:**

  <Tip>
    Let $E_1$ and $E_2$ be events in the sample space $S$. Then

    <br />

    $~~~~~~~~~~ p(E_1 \cup E_2) = p(E_1) + p(E_2) - p(E_1 \cap E_2)$.

    <br />
  </Tip>
</Card>

### Example

<Card>
  What is the probability that a positive integer selected at random from the set of positive integers not exceeding 100 is divisible by either 2 or 5?

  **Solution:**

  <Check>
    Let $E_1$ be the event that the integer selected at random is divisible by 2, and let $E_2$ be the event that it is divisible by 5.

    <br />

    Then $E_1 \cup E_2$ is the event that it is divisible by either 2 or 5.

    <br />

    Also, $E_1 \cap E_2$ is the event that it is divisible by both 2 and 5, or equivalently, that it is divisible by 10.

    <br />

    Because $|E_1| = 50, |E_2| = 20$, and $|E_1 \cap E_2| = 10$, it follows that

    <br />

    $~~~~~~~~~~ p(E_1 \cup E_2) = p(E_1) + p(E_2) - p(E_1 \cap E_2)$

    <br />

    $~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ = \dfrac{50}{100} + \dfrac{20}{100} - \dfrac{10}{100} = \dfrac{3}{5}$.

    <br />
  </Check>
</Card>
