# Probability

How to find the probability of an event: definition, examples, and their solutions.

## Definition

The probability of an event can be found
by using the formula below.

P(A) = n(A)/n(S)

P(A): Probability of the event A happening
n(A): Number of ways of the event A happening
n(S): Total number of ways
(= Number of space sample)

S stands for the [sample space].

The probability has a value between 0 and 1.

P(A) = 0 means
the event A doesn't happen.

P(A) = 1 means
the event A always happens.

So 0 ≤ P(A) ≤ 1.

## Example 1

A die has 6 sides: from 1 to 6.

So there are 6 ways to get a number.

So n(S) = 6.

Set the event A as getting a 3.

There's 1 way to get a 3.

So n(A) = 1.

n(S) = 6
n(A) = 1

So the probability of getting a 3 is
P(A) = 1/6.

## Example 2

A die has 6 sides: from 1 to 6.

So there are 6 ways to get a number.

So n(S) = 6.

Set the event A as
getting an odd number.

The odd numbers from 1 to 6 are
{1, 3, 5}.

There are 3 ways
to get an odd number.

So n(A) = 3.

n(S) = 6
n(A) = 3

So the probability of getting an odd number is
P(A) = 3/6.

Divide the numerator and the denominator by 3.

Then 3/6 = 1/2.

## Example 3

Numbers from 1 to 30 are given.

So there are 30 numbers
that can be picked.

So n(S) = 30.

Set the event A as
picking a prime number.

The prime numbers from 1 and 30 are
{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}.

There are 10 prime numbers
that can be picked.

So n(A) = 10.

n(S) = 30
n(A) = 10

So P(A) = 10/30.

Divide the numerator and the denominator by 10.

Then 10/30 = 1/3.

## Example 4

The spinner is divided into five parts:
from 1 to 5.
And each part has the same area.

So there are 5 ways
that the arrow can land.

So n(S) = 5.

[X = 2] means
the event of landing at 2.

There's only 1 way
that the arrow can land at 2.

So n(A) = 1.

n(S) = 5
n(X = 2) = 1

So P(X = 2) = 1/5.

## Example 5

The pizza is divided into 8 pieces.

So n(S) = 8.

Set the event A as
choosing the piece with pepperoni.

There are 5 pieces
that have pepperoni on them.

So n(A) = 5.

n(S) = 8
n(A) = 5

So P(A) = 5/8.