Monday, April 27, 2020

Are you a Cylon in Battlestar Galactica?

Note: there are errors contained in this post.  See errata here.

Of course I'm not. A few variables complicate this. Foremost is that it depends on when in the game you're asking about. In most cases, each player receives one loyalty card at the beginning of the game, and second one in the middle of the game during the sleeper agent phase. However, two characters (Baltar and Boomer) draw an extra loyal card (at the beginning and middle of the game, respectively) and each add an extra human loyalty card into the mix. It also depends on how many players there are, and thus how many Cylon cards there are. Having one or more Cylon cards makes you a Cylon.

Let's consider the five player case (two Cylons), and assume Baltar and Boomer are not involved. Thus, there are ten loyalty cards in use, eight human and two Cylon. I'll get dealt two loyalty card throughout the game. During the first half, the probability that I'm a Cylon is,
\begin{align}
P(\text{Cylon}) = \frac{2}{10}.
\end{align}
(This is assuming that we don't count drawing a Cylon card later as having been a Cylon all along. This assumption is not necessarily valid on two fronts. First, in the fiction, characters do not become Cylons. Second, if the loyalty deck were already shuffled at the beginning of the game and the order in which they will be dealt determined, then my fate as human or Cylon would be sealed already—ignoring a revealed Cylon giving me a Cylon card—I just don't know it yet.)
There are two cards out of the ten possible that could make me a Cylon at the beginning of the game. Next, let's consider the entirety of the game. Since I could be a Cylon card at the beginning, middle, or both, it's easier to frame being a Cylon as being mutually exclusive as being human. That is,
\begin{align}
P(\text{Cylon}) + P(\text{human}) = 1.
\end{align}
Which we can rearrange to find the probability of being a Cylon.
\begin{align}
P(\text{Cylon}) = 1 - P(\text{human})
\end{align}
To be human, I must get two human cards.
\begin{align}
P(\text{human}) &= P(\text{first human} \cap \text{second human})
\end{align}
Here the probability $P(\text{first human}\,  \cap \, \text{second human})$ is the probability that my first card is human and my second card is human. The symbol $\cap$ is for intersection, which essentially means and. These events are not independent, so we express the joint probability as follows.
\begin{align}
P(\text{human}) &= P(\text{first human}) \cdot P(\text{second human} | \text{first human})
\end{align}
The probability of getting the first human card is in some sense the opposite of getting a Cylon card as my first card.
\begin{align}
P(\text{first human}) &= 1 - \frac{2}{10} \\
P(\text{first human}) &= \frac{8}{10}
\end{align}
We can also see this as there are eight human cards out of ten total loyalty cards.

The second term is one of conditional probability: the probability that the second card is human given the fact that the first card is human. Here the vertical bar, $|$,  means given. Knowing whether the first card is human or not affects the probability of the second card. If I don't know anything about the first card, the probability is the same.
\begin{align}
P(\text{second human}) &= \frac{8}{10}
\end{align}
Given that I've gotten a human card first, there are seven human cards left out of a total of nine loyalty cards.
\begin{align}
P(\text{second human} | \text{first human}) &= \frac{7}{9}
\end{align}
Or given that I got a Cylon card first, there would be eight human cards left out nine total.
\begin{align}
P(\text{second human} | \text{first Cylon}) &= \frac{8}{9}
\end{align}
We can now combine the results to find the probability that I'm a Cylon.
\begin{align}
P(\text{Cylon}) &= 1 - P(\text{first human}) \cdot P(\text{second human} | \text{first human}) \\
&= \frac{8}{10} \cdot \frac{7}{9} \\
&= \frac{56}{90} = \frac{28}{45} = \frac{2\cdot 2 \cdot 7}{3\cdot 3\cdot 5} \\
&\approx 0.622
\end{align}
What we've done is correct, but the result is not useful because you always have some information; you know your own card(s). There are three cases: you have no Cylon card, you have one Cylon card, and you have two Cylon cards. The last case is the simplest to dispatch. Since there are only two Cylon cards and you have them both, I have no chance of being a Cylon.
\begin{align}
P(\text{I'm Cylon} | \text{you have two Cylon cards}) = 0
\end{align}
For the other cases, where you have zero or one Cylon cards, can be computed as variations on the earlier analysis. I leave this as an exercise for the reader.

You may gain additional information at some point in the game though. There are a number of scenarios in which you may be able to randomly look at one of my loyalty cards. Interestingly, it matters whether you do this before or after the sleeper agent phase.

Let's consider the case where you're human and earlier in the game, before the sleeper agent phase, you got to look at my (then) only loyalty card. Then, the only possibility of me being a Cylon is that I get one for my second loyalty card. You've seen three human cards, two of yours and one of mine. Leaving seven out of ten about whose location you know nothing. Thus, the probability that I'm a Cylon is,
\begin{align}
P(\text{second Cylon} | \text{first human}) &= \frac{2}{7} \approx 0.286.
\end{align}
However, if you saw one of my two cards after the sleeper agent phase, the probability is different because while you know that I don't have two Cylon cards, you don't know whether you looked at my first or second loyalty card. We'll find the probabilities ignoring what you saw first. You know that you have two human cards, so eight cards are unknown. The probability that I am human given that you are human is,
\begin{align}
P(\text{human}) &= \frac{6}{8}\cdot\frac{5}{7} \approx 0.536.
\end{align}
The probability that I have one Cylon card and one human card is the sum of the probability of two cases. In the first, I get a Cylon card then a human card. In the second, I get a human card then a Cylon card. Calculating these probabilities is very similar to the earlier calculations
\begin{align}
P(\text{human then Cylon}) &= P(\text{first human}) \cdot P(\text{second Cylon} | \text{first human}) \\
&= \frac{6}{8} \cdot \frac{2}{7} \\
P(\text{Cylon then human}) &= P(\text{first Cylon}) \cdot P(\text{second human} | \text{first Cylon}) \\
&= \frac{2}{8} \cdot \frac{6}{7} \\
\end{align}
We can add these up since they are disjoint. As you can see, the probabilities are equal.
\begin{align}
P(\text{1 Cylon}) &= P(\text{human then Cylon}) + P(\text{Cylon then human}) \\
&=  \frac{6}{8} \cdot \frac{2}{7} + \frac{2}{8} \cdot \frac{6}{7}\\
&= 2 \cdot  \frac{6}{8} \cdot \frac{2}{7} \\
& \approx 0.429
\end{align}
The probability that I'm Cylon given that you saw I have one human card involves scaling the probability that I have one Cylon card  by the probability that I have at least one human card.
\begin{align}
P(\text{Cylon} | \geq 1 \text{ human card}) &= \frac{P(\text{1 Cylon})}{P( \geq 1 \text{ human card})} \\
&= \frac{P(\text{1 Cylon})}{P(\text{1 Cylon}) + P(\text{human})} \\
&= \frac{  2 \cdot  \frac{6}{8} \cdot \frac{2}{7} } { 2 \cdot  \frac{6}{8} \cdot \frac{2}{7} +  \frac{2}{8} \cdot \frac{6}{7}} \\
&= \frac{  2 \cdot  6 \cdot 2 } { 2 \cdot  6 \cdot 2 +  2 \cdot 6} \\
&= \frac{  6 \cdot 2 } {  6 \cdot 2 +  6} \\
&= \frac{  6 \cdot 2 } {  6 \cdot 3 } \\
&= \frac{  2 } {  3 } \\
& \approx 0.667
\end{align}
Note that this is substantially higher than if you had seen my first loyalty card. If you think about these two scenarios vaguely, they seem like they may be the same. In both cases you saw that one of my loyalty cards is human. However, in the first case you saw my first card, which is not specified in the second case. In the second case, all we know is that at least one of my cards is human. This is related to the woman in the park with the two kids problem referenced in our discussion of Catan. The lack of ambiguity is especially clear in the Cylon probabilities discussed here. Differentiating the two cases is worth understanding, especially when given information more abstractly without the origin of that information made clear.

No comments:

Post a Comment