-= Puzzle 8: The Amazing Digital Stoats =-

On the eight day at BitFlop Laboratories, Monday strikes again, and you are assigned to the Digital Stoat department.

Digital stoats are stoats whose brains have been mapped 1:1 into a digital simulation.

The company uses them to test new stoat technologies before releasing them to the general stoat population.

Don't worry, the digital stoats are actually living in digital paradise, and they are very happy with their digital lives.

Every digital stoat belongs to a group, represented by a single letter.

Each group has one or more evolution rules that describe what happens when a stoat evolves.

For example:

A A C
A B C
A C B
B B A B A
B C B A
C C B B

The first letter is the group that evolves, and the remaining letters are the stoats that replace it.

For example, the first rule,

A A C

means that a stoat in group A evolves into two stoats: one in group A and one in group C.

Some groups have multiple evolution rules, for example the group A has three evolution rules in the example.

When a stoat evolves, it chooses the first evolution rule in the list, all other evolution rules for that group are ignored.

So for the example above:

The original stoat that evolves is replaced by the new stoats, so it won't be present in the next generation anymore.

Your starting population of stoats is a single stoat of group A and a single stoat of group B.

Each "generation", every stoat evolves simultaneously according to the rules.

For the example, with the example rules:

Generation 0: AB (start)
Generation 1: ACBABA
Generation 2: ACCBBBABAACBABAAC
Generation 3: ACCBBCBBBABABABABABAACBABAACACCBBBABAACBABAACACCBB
Generation 4: 151 digital stoats
Generation 5: 456 digital stoats
Generation 6: 1369 digital stoats
Generation 7: 4102 digital stoats

After 7 generations, there are 4102 digital stoats in total.

How many digital stoats are there after 7 generations?

You must login to get your input and play!