thumb|263x263px|A visual representation of a finite sample space and events. The red oval is the event that a number is odd, and the blue oval is the event that a number is prime.

In probability theory, the sample space (also called sample description space, possibility space, or outcome space) of an experiment or random trial is the set of all possible outcomes or results of that experiment. A sample space is usually denoted using set notation, and the possible ordered outcomes, or sample points, are listed as elements in the set. It is common to refer to a sample space by the labels S, Ω, or U (for "universal set"). The elements of a sample space may be numbers, words, letters, or symbols. They can also be finite, countably infinite, or uncountably infinite.

A subset of the sample space is an event, denoted by <math>E</math>. If the outcome of an experiment is included in <math>E</math>, then event <math>E</math> has occurred.

For example, if the experiment is tossing a single coin, the sample space is the set <math>\{H,T\}</math>, where the outcome <math>H</math> means that the coin is heads and the outcome <math>T</math> means that the coin is tails. The possible events are <math>E=\{\}</math>, <math>E=\{H\}</math>, <math>E = \{T\}</math>, and <math>E = \{H,T\}</math>. For tossing two coins, the sample space is <math>\{HH, HT, TH, TT\}</math>, where the outcome is <math>HH</math> if both coins are heads, <math>HT

</math> if the first coin is heads and the second is tails, <math>TH</math> if the first coin is tails and the second is heads, and <math>TT</math> if both coins are tails. The event that at least one of the coins is heads is given by <math>E = \{HH,HT,TH\}</math>.

For tossing a single six-sided die one time, where the result of interest is the number of pips facing up, the sample space is <math>\{1,2,3,4,5,6\}</math>.

A well-defined, non-empty sample space <math>S</math> is one of three components in a probabilistic model (a probability space). The other two basic elements are a well-defined set of possible events (an event space), which is typically the power set of <math>S</math> if <math>S</math> is discrete or a &sigma;-algebra on <math>S</math> if it is continuous, and a probability assigned to each event (a probability measure function).

A sample space can be represented visually by a rectangle, with the outcomes of the sample space denoted by points within the rectangle. The events may be represented by ovals, where the points enclosed within the oval make up the event.

Conditions of a sample space

A set <math>\Omega</math> with outcomes <math>s_1, s_2, \ldots, s_n</math> (i.e. <math>\Omega = \{s_1, s_2, \ldots, s_n\}</math>) must meet some conditions in order to be a sample space:

  • The outcomes must be mutually exclusive, i.e. if <math>s_j</math> occurs, then no other <math>s_i</math> will take place, <math>\forall i,j=1,2,\ldots,n \quad i\neq j</math>. A more complete description of outcomes, however, could specify both the denomination and the suit, and a sample space describing each individual card can be constructed as the Cartesian product of the two sample spaces noted above (this space would contain fifty-two equally likely outcomes). Still other sample spaces are possible, such as right-side up or upside down, if some cards have been flipped when shuffling.

Equally likely outcomes

thumb|Flipping a coin leads to a sample space composed of two outcomes that are almost equally likely.

thumb|120px|alt=A brass tack with point downward | Up or down? Flipping a brass tack leads to a sample space composed of two outcomes that are not equally likely.

Some treatments of probability assume that the various outcomes of an experiment are always defined so as to be equally likely. For any sample space with <math>N</math> equally likely outcomes, each outcome is assigned the probability <math>\frac{1}{N}</math>. However, there are experiments that are not easily described by a sample space of equally likely outcomes—for example, if one were to toss a thumb tack many times and observe whether it landed with its point upward or downward, there is no physical symmetry to suggest that the two outcomes should be equally likely.

Though most random phenomena do not have equally likely outcomes, it can be helpful to define a sample space in such a way that outcomes are at least approximately equally likely, since this condition significantly simplifies the computation of probabilities for events within the sample space. If each individual outcome occurs with the same probability, then the probability of any event becomes simply:

: <math>\mathrm{P}(\text{event}) = \frac{\text{number of outcomes in event{\text{number of outcomes in sample space</math>

For example, if two fair six-sided dice are thrown to generate two uniformly distributed integers, <math>D_1</math> and <math>D_2</math>, each in the range from 1 to 6, inclusive, the 36 possible ordered pairs of outcomes <math>(D_1,D_2)</math> constitute a sample space of equally likely events. In this case, the above formula applies, such as calculating the probability of a particular sum of the two rolls in an outcome. The probability of the event that the sum <math>D_1 + D_2</math> is five is <math>\frac{4}{36}</math>, since four of the thirty-six equally likely pairs of outcomes sum to five.

If the sample space was all of the possible sums obtained from rolling two six-sided dice, the above formula can still be applied because the dice rolls are fair, but the number of outcomes in a given event will vary. A sum of two can occur with the outcome <math>\{(1,1)\}</math>, so the probability is <math>\frac{1}{36}</math>. For a sum of seven, the outcomes in the event are <math>\{(1,6), (6,1), (2,5), (5,2), (3,4),(4,3)\}</math>, so the probability is <math>\frac{6}{36}</math>.

Simple random sample

In statistics, inferences are made about characteristics of a population by studying a sample of that population's individuals. In order to arrive at a sample that presents an unbiased estimate of the true characteristics of the population, statisticians often seek to study a simple random sample—that is, a sample in which every individual in the population is equally likely to be included.

Infinitely large sample spaces

In an elementary approach to probability, any subset of the sample space is usually called an event.