Chapter 2.2 Variable Types and Terminology of the textbook The Elements of Statistical Learning, second edition, by Hastie, Tibshirani, and Friedman, says the following:
Qualitative variables are typically represented numerically by codes. The easiest case is when there are only two classes or categories, such as "success", "failure," "survived" or "died." These are often represented by a single binary digit or bit as $0$ or $1$, or else by $-1$ and $1$. For reasons that will become apparent, such numeric codes are sometimes referred to as targets. When there are more than two categories, several alternatives are available. The most useful and commonly used coding is via dummy variables. Here a $K$-level qualitative variable is represented by a vector of $K$ binary variables or bits, only one of which is "on" at a time. Although more compact coding schemes are possible, dummy variables are symmetric in the levels of the factor.
I'm curious about this part:
When there are more than two categories, several alternatives are available. The most useful and commonly used coding is via dummy variables. Here a $K$-level qualitative variable is represented by a vector of $K$ binary variables or bits, only one of which is "on" at a time. Although more compact coding schemes are possible, dummy variables are symmetric in the levels of the factor.
How exactly does this work? I'd appreciate an example/demonstration.