# Definition:Binary Variable

Jump to navigation
Jump to search

## Definition

A **binary variable** is a random variable which can take one of only $2$ values.

It is conventional for the purposes of data analysis to encode such **binary variables** by use of a random variable which takes the values $0$ and $1$.

## Examples

### Gender

A record of the gender of a newborn baby will generally be implemented as a **binary variable**.

Hence, for example, **male** may be encoded as $0$, and **female** as $1$.

### Presence or Absence

The presence or absence of a bacterium in a clinical sample may be implemented as a **binary variable**.

Hence, for example, **absent** may be encoded as $0$, and **present** as $1$.

### Bernoulli Trial

The outcome of a **Bernoulli trial** may be implemented as a **binary variable**.

Hence, for example, the outcome from a coin-tossing exercise: **heads** may be encoded as $0$, and **tails** as $1$.

## Also see

- Results about
**binary variables**can be found**here**.

## Sources

- 1998: David Nelson:
*The Penguin Dictionary of Mathematics*(2nd ed.) ... (previous) ... (next):**binary variable** - 2008: David Nelson:
*The Penguin Dictionary of Mathematics*(4th ed.) ... (previous) ... (next):**binary variable**