How rare are brown pandas?

Just how rare are these brown pandas in Minecraft, I didn't see stats on the wiki. So basically what percent chance is there that a brown panda will spawn?

The wiki states that pandas spawn with a randomized personality. Each panda has a dominant gene and a recessive gene, each of which is randomly selected from the 7 possible genes. For a panda to be brown, both genes must be the brown type. Without taking mutation into account, the probability of a given panda being spawned as brown is then ​1⁄7 x ​1⁄7 = ​1⁄49 or 2.04%.

However, there is also the mutation mechanic to consider: every gene has a ​1⁄32 chance of mutating into something else, and this applies to spawned as well as bred pandas. This complicates things a quite a bit. Because of mutation we have to consider several additional possibilities:

1. A panda with exactly one brown gene can mutate into a panda with two brown genes:

According to the wiki table of possible gene configurations, there are 12 possible gene pairs that have exactly 1 brown gene, out of the total of 49 possible pairs. In order for a panda with exactly one brown gene to become fully brown, the non-brown gene must mutate, and it must turn into a brown gene. The probability for this is calculated by the following equation: P(only the non-brown gene mutating) = P(any gene to mutate) x P(any gene to not mutate) x P(the non-brown gene to be the one that does mutate) = 1⁄32 x 31⁄32 x 1⁄2 = 31⁄2048. Then there is the ​2⁄16 chance that it will become brown: 31⁄2048 x ​2⁄16 = ​62⁄32768. The probability of a panda spawning with exactly one brown gene and mutating into one with two brown genes is then: 12⁄49 x 62⁄32768 = 744⁄1605632 or 0.0463%.

2. A panda with no brown genes can mutate into a panda with two brown genes:

Of the 49 possible gene configurations, 36 have no brown genes at all. This kind of panda then has a natural occurrence of 36⁄49. The probability for both genes mutating is ​1⁄32 x 1⁄32 = 1⁄1024. The probability of both mutated genes becoming brown is 2⁄16 x 2⁄16 = 1⁄64. The probability of both genes mutating and both becoming brown is then 1⁄1024 x 1⁄64 = 1⁄65536. The probability of a panda spawning without any brown genes then mutating into one with two brown genes is then 36⁄49 x 1⁄65536 = 36⁄3211364 or 0.00112%.

3. A brown panda can mutate into a not-brown panda:

A brown panda will become not-brown if either gene mutates. The probability of either gene mutating uses the equation P(A or B) = P(A) + P(B) - P(A and B) = 1⁄32 + 1⁄32 - (1⁄32 x 1⁄32) = 2⁄32 - 1⁄1024 = 63⁄1024.

If the mutating gene stays brown, nothing will happen. There is a 2⁄16 chance of that, so there is a 14⁄16 chance of mutating into something else: 63⁄1024 x 14⁄16 = 882⁄16384.

Since brown pandas occur as 1⁄49 and the chance of a brown panda turning into a not-brown panda is 882⁄16384, there is a 1⁄49 x 882⁄16384 = 882⁄802816 or 0.109% chance of a panda being spawned with two brown genes and mutating into one with less than two brown genes.

Taking all this into consideration, the chance of a brown panda getting spawned is as follows:

• The chance of a panda being spawned with two brown genes and not mutating: 1⁄49 x (31⁄32 x 31⁄32) = 1⁄49 x 961⁄1024 = 961⁄50176 or 1.915%

• Plus the chance of getting a panda with exactly one brown gene that mutates into a fully brown panda: 0.04633%

• Plus the chance of getting a panda with no brown genes that mutates into a fully brown panda: 0.00112%

• Minus the chance of a brown panda mutating into a not-brown panda: 0.1098%

Summing these chances: 1.915% + 0.04633% + 0.00112% - 0.1098% = 1.853% for a given naturally occurring panda to be brown.

According to the wiki, a spawned panda has 1/49 chance of being brown or weak as they're both recessive genes. There are seven kinds of panda and two genes, a main gene and 'hidden' gene. The other five types of panda are dominant, so they'll be expressed if they show up in the 'main' gene.