Suppose 3 cars can either turn left $(L)$, turn right $(R)$, or go straight $(S)$. I need to find the sample space for all the possibilities but I am not sure how to do that. I know that for 3 cars with 2 possibilities produces the sample space $S=\{RRR,RRL,RLR,RLL,LRR,LRL,LLR,LLL\}$. But adding on a third possibility confuses me. Is here a systematic way to list all possibilities? I also vague remember there was a formula to calculate the total number of possibilities, it was something like for $n$ choices, there are $2^n$ possibilities.
How would I systematically list all the possibilities?
If there are $k$ "cars" and each car has $m$ choices, the total number of choices is $m^k$.
So in the case of $3$ cars and $3$ choices, the sample space has $3^3$ elements.
As far as listing goes, whether a way to list is good depends on the kind of information you need quick access to. The issues are complex and important. However, what the three cars do can be thought of as a word of length $3$ over the alphabet L, R, S. Listing alphabetically seems reasonable. So the first nine items are LLL, LLR, LLS, LRL, LRR, LRS, LSL, LSR, LSS.
If we think of L as the digit $0$, R as $1$, and S as $2$, then we can think of our string as a "three-digit" number is base $3$.