Sample space is one of the basic concepts learned in the study of Probability. The theory of probability grew by conducting random experiments and analyzing the results of such of experiments. Sample space forms the basis for evaluating the chance of occurrence of any event during the process of the probability experiment.

An outcome is the result of a single trial of a probability experiment.
Sample space is the set of all possible outcomes of a probability experiment.There are finite as well as infinite sample spaces. While Finite sample spaces have a countable number of possible outcomes, infinite sample spaces have uncountable number of possible outcomes.

Finite sample spaces of simple experiments can be displayed by listing all possible outcomes.

Examples:

Experiment
Sample Space
Tossing a coin {Head, Tail}
Throwing a six faced die {1,2,3,4,5,6}
Answering a true or false question (True, False}
Choosing an odd digit. {0.2.4.6.8}

Infinite sample spaces are written using set builder notation.

Example:

Suppose the height requirement for a recruitment is between $62$ inches and $80$ inches, then the sample space can be written as

$S$ = $\{ x\ |\ 62\ \leq$ = $x$ = $80 \}$
Tree diagrams are used to determine the sample space when the probability experiment consists of two or more activities or occurrences.
Definition: A tree diagram is a method used to find all possible events of a probability experiment, where the outcomes are connected with their starting points by arrows.Examples:

A High School Literary committee of $5$ members consists of $3$ Seniors and $2$ Juniors. Find the number of ways a two member team for a Quiz contest consisting of one Junior and one Senior can be selected.

Sample Space Tree Diagram

The above tree diagram depicts the selection process. One Senior can be selected from three. And for each of this possible selection a Junior can be added in two ways. Thus there are $6$ outcomes in the sample space, which are listed as ordered pairs in the diagram.

The following tree diagram shows the method to find the genders of children in a family.

Sample Space Diagram

Each child in order can be a Boy or Girl. These possibilities are combined in order and the sample space consists of $8$ possible outcomes which are listed in the diagram.
Theoretical or classical probability uses sample space to evaluate the probability of events numerically. Theoretical probability assumes that all outcomes in the sample space are equally likely to occur.
Thus the probability of the occurrence of an event $E$ is given by the formula,

P(E) = $\frac{n(E)}{n(S)}$


Where $n(E)$ is the number of outcomes favorable to $E$ and $n(S)$ is the number of outcomes in the sample space $S$.

Probability of the sample space is the probability of the occurrence of any one outcome of the sample space. Extending the above formula the probability of sample space is given by

$P(S)$ = $\frac{n(S)}{n(S)}$ = $1$

Solved Examples

Question 1: Find the probability of turning an even number up when a six sided fair die is thrown.
Solution:
 
Let the E be the event of turning up an even number. Then the outcomes in the sample space and E are as follows:
S = { 1, 2, 3, 4, 5, 6 )                      6 outcomes in sample space
E = { 2, 4, 6 }                                  3 outcomes in the event E.

P(E) = $\frac{n(E)}{n(S)}$ = $\frac{3}{6}$ = $\frac{1}{2}$.

The number of outcomes in the sample space is often determined using combinatorics formulas like permutation and combination, without actually listing the outcomes.
 

Question 2: A card is drawn at random from a pack of 52 cards. Find the number of elements in the sample space and also determine the probability of drawing a red card.
Solution:
 
As we need to pick one card from 52, this is a case of combination.
Hence the number of elements in the sample space n(S) = 52C1 = 52.
Let E be the event of picking a red card. As this red card has to come from 26 cards (13 Hearts + 13 Diamonds)
Number of elements in the event E  n(E) = 26C1 = 26.

Probability of picking a red card P(E) = $\frac{n(E)}{n(S)}$ = $\frac{26}{52}$ = $\frac{1}{2}$.
 

Example 1:

Sometimes the sample space can be written in tabular form, like the outcomes when two dice are rolled. Here each outcome is an ordered pair as follows:

Die I Die II
1
2
3 4
5
6
1 (1,1) (1,2) (1,3) (1,4) (1,5) (1,6)
2 (2,1) (2,2) (2,3) (2,4) (2,5) (2,6)
3 (3,1) (3,2) (3,3) (3,4) (3,5) (3,6)
4 (4,1) (4,2) (4,3) (4,4) (4,5) (4,6)
5 (5,1) (5,2) (5,3) (5,4) (5,5) (5,6)
6 (6,1) (6,2) (6,3) (6,4) (6,5) (6,6)

It can be seen there are $36$ elements in the sample space.
Example 2:

A security system uses a five digit code using the numbers $0$ to $9$. If the digits can be repeated, write a rule to define the sample space and find number of elements in the sample space.

The sample space consists of five digit numbers as follows

$00000,\ 01234$ ..................

$10756,\ 11111$ ..................

The sample space can be defined as follows:

$S$ = $\{ xxxxx\ |\ x\ \epsilon\ \{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 \}$

As repetition of digits is allowed, each digit can be chosen in $10$ ways

Hence the number of elements in sample space = $10 \times 10 \times 10 \times 10 \times 10$ = $100,000$.