The Science and Mathematics of Blockchain Cuties Breeding

While you can breed cuties randomly, some basic theory can make it a lot easier to breed cuties with a purpose. This article will cover some basics of genetics, probability and statistics, combinatorics, as well as specifics of how they relate to breeding.

Daniel Goldman
Jun 25, 2019 · 7 min read

Genetics

Probability

One of the most basic examples of a random process is flipping a coin. Now, because physics is involved, it’s not truly random, or unbiased, however in most cases, we simplify matters by assuming it is. The odds of either a head or a tail on a flip is 0.5 or 50%. The coin example is a good one, because in BC breeding, we have a 50% chance of a gene coming from a mother and 50% chance of it coming from the father.

A success, in a trial or experiment is getting the desired outcome. For instance, if you want to find the probability of getting a head, a head is a success. To calculate the probability of an event, we calculate the number of ways in which we can get a success, and divide it by the total number out potential outcomes. In the case of a coin, it’s just one way to get a success, and there are two potential outcomes (head or tail) so the probability is 1/2 or 50%.

One iteration of a random process is called a “trial” or an “experiment.” By knowing the kind of random process, we can start to discuss multiple trials. The easiest cases are when each trial is independent. Two independent trials do not impact each other. Coin flips are generally considered random.

One of the most common examples of a process where trials aren’t independent is having a jar of items and removing some of those items each time. For instance, if there are 10 blue marbles and 50 red marbles, then the probability of selecting a blue marble is 10/60, since there are 10 ways to get a success, while there are 60 different outcomes. However, once we take a marble out, the numbers change, and so the trials are not independent.

Luckily breeding involves independent trials. The probability of getting one gene from a given parent doesn’t depend on the others. The only issue is dealing with recessives, but I’ll cover that in a minute. For now, how do you figure out probabilities involving multiple trials? What if you want to know the probability of getting 5 heads out of 19 trials, or in terms of breeding, getting the 5 alleles that you need to get the desired trait.

That’s the probability of getting the first trait, and the second, and the third, and the fourth, and the fifth. So long as trials are independent, you can just multiply the probability of each success, or in this case 0.5⁵. That gets low pretty quickly. The probability of getting all five alleles, ignoring recessives, is only about 3%. So does that mean you can breed 100 and know you’ll get 3? Nope. You cannot know ahead of time what the results of a random process will be. Maybe you’ll end up with 10 successes, or maybe you’ll get none.

Successful Breeding

Two events A and B are complementary if either one must occur or the other must occur, but they cannot both occur. So for instance, a coin must come up heads or tails, but it cannot be both. These kinds of events have the following relationship: P(A) =1-P(B). So what’s the complement of at least one success? It’s zero successes, or all failures. So now we need to know the probability of a failure. Luckily we can apply our rule again. A success and a failure are complementary, so P(failure) = 1-P(success).

So the probability of a failure is 1-P(success), which is 1–0.5⁵. There are 100 trials, and each one is a failure, so we raise that whole quantity to the 100th power. Then we want to subtract that from one. I could make this tutorial look prettier if Medium had LaTeX support, but the result is about 95.8% so we’ve got a 95.8% chance of getting at least one out of 100 breeds.

Of course, if some of the alleles match in both positions, it gets even easier, as you only need to worry about the ones that are different. However, you also have to worry about recessive traits.

There’s a 4% chance that recessive #2 genes end up as a dominant gene and a 20% chance of a recessive #1 trait becoming a dominant trait. I already mentioned the rule to calculate probabilities of compound events when you want to know the probability of both occurring, but what about the probability of either occurring?

The probability of events A or B occurring is equal to the sum of the two, less the probability of them both occurring. If A and B are complementary though, the product of them both occurring is zero, which makes things easier. In this case, the recessive #1 and recessive #2 traits cannot both become dominant, so it’s just the sum of each probability: the probability of a either recessive trait becoming a dominant trait is 0.24.

So now we can reevaluate the probability of getting a given allele from the parent we want. Instead of 50%, we need to ensure that (1) the dominant trait hasn’t been replaced and (2) that it is transferred to the offspring. So we have P(stays dominant AND transfers). Well, staying dominant is the complement of changing, so that’s 1–0.24 or 76%. The probability of the allele transferring is 50%, so the product is 38%.

We can then redo our earlier analysis. The probability of getting 5 desired alleles is 0.38⁵ or less than 1%. That’s why it’s so useful to have purebreds if you can create them.

Combinatorics

In some ways, it’s from combinatorics that we get some of our other rules, including the rule for calculating the probability of A and B occurring. If you have two slots, and slot one has m options and the other has n options, then the total number of options you can have is m*n. It’s a useful rule. The school restaurant menu example is a common one to help explain it. Suppose you a cafeteria offers 2 appetizers, 5 entrees, 3 desserts, and 3 drinks. How many different meal combinations can you make? It’s simply the product of all of those options, because they’re all independent and so you have 2*5*3*3 = 90 options.

That’s one reason why a genome with only 19 dominant traits is still a lot. Each gene can have 0-F, or 16 alleles. So that’s 16¹⁹ combinations. Even taking into account that most of those combinations do little, and that some traits are compound traits requiring a specific set of allele combinations, that’s still millions of potential combinations with unique features! By the way, if all 16 alleles were available for all 19 genes, there could be more genetically unique cuties than grains of sand on Earth (7.5*10²² vs 7.5*10¹⁸).

Summary

The B.C.U. Times

The B.C.U.

Daniel Goldman

Written by

I’m a polymath and a rōnin scholar. That is to say that I enjoy studying many different topics. Find more at http://danielgoldman.us

The B.C.U. Times

The B.C.U. Times is a publication dedicated to the promotion of the blockchain and cryptoasset user experience and ecosystem.

Daniel Goldman

Written by

I’m a polymath and a rōnin scholar. That is to say that I enjoy studying many different topics. Find more at http://danielgoldman.us

The B.C.U. Times

The B.C.U. Times is a publication dedicated to the promotion of the blockchain and cryptoasset user experience and ecosystem.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store