WolframAlpha.com
WolframCloud.com
All Sites & Public Resources...
Products & Services
Wolfram|One
Mathematica
Wolfram|Alpha Notebook Edition
Programming Lab
Finance Platform
SystemModeler
Wolfram Player
Wolfram Engine
WolframScript
Enterprise Private Cloud
Enterprise Mathematica
Wolfram|Alpha Appliance
Enterprise Solutions
Corporate Consulting
Technical Consulting
Wolfram|Alpha Business Solutions
Resource System
Data Repository
Neural Net Repository
Function Repository
Wolfram|Alpha
Wolfram|Alpha Pro
Problem Generator
API
Data Drop
Products for Education
Mobile Apps
Wolfram Player
Wolfram Cloud App
Wolfram|Alpha for Mobile
Wolfram|Alpha-Powered Apps
Services
Paid Project Support
Wolfram U
Summer Programs
All Products & Services »
Technologies
Wolfram Language
Revolutionary knowledge-based programming language.
Wolfram Cloud
Central infrastructure for Wolfram's cloud products & services.
Wolfram Science
Technology-enabling science of the computational universe.
Wolfram Notebooks
The preeminent environment for any technical workflows.
Wolfram Engine
Software engine implementing the Wolfram Language.
Wolfram Natural Language Understanding System
Knowledge-based broadly deployed natural language.
Wolfram Data Framework
Semantic framework for real-world data.
Wolfram Universal Deployment System
Instant deployment across cloud, desktop, mobile, and more.
Wolfram Knowledgebase
Curated computable knowledge powering Wolfram|Alpha.
All Technologies »
Solutions
Engineering, R&D
Aerospace & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Mechanical Engineering
Operations Research
More...
Finance, Statistics & Business Analysis
Actuarial Sciences
Bioinformatics
Data Science
Econometrics
Financial Risk Management
Statistics
More...
Education
All Solutions for Education
Trends
Machine Learning
Multiparadigm Data Science
Internet of Things
High-Performance Computing
Hackathons
Software & Web
Software Development
Authoring & Publishing
Interface Development
Web Development
Sciences
Astronomy
Biology
Chemistry
More...
All Solutions »
Learning & Support
Learning
Wolfram Language Documentation
Fast Introduction for Programmers
Wolfram U
Videos & Screencasts
Wolfram Language Introductory Book
Webinars & Training
Summer Programs
Books
Need Help?
Support FAQ
Wolfram Community
Contact Support
Premium Support
Paid Project Support
Technical Consulting
All Learning & Support »
Company
About
Company Background
Wolfram Blog
Events
Contact Us
Work with Us
Careers at Wolfram
Internships
Other Wolfram Language Jobs
Initiatives
Wolfram Foundation
MathWorld
Computer-Based Math
A New Kind of Science
Wolfram Technology for Hackathons
Student Ambassador Program
Wolfram for Startups
Demonstrations Project
Wolfram Innovator Awards
Wolfram + Raspberry Pi
Summer Programs
More...
All Company »
Search
WOLFRAM COMMUNITY
Connect with users of Wolfram technologies to learn, solve problems and share ideas
Join
Sign In
Dashboard
Groups
People
Message Boards
Answer
(
Unmark
)
Mark as an Answer
GROUPS:
Staff Picks
Biological Sciences
Data Science
Graphics and Visualization
Wolfram Language
Modeling
Statistics and Probability
5
Pedro Cabral
Simulating "Animal Crossing: New Horizons" Mendelian Flower Genetics
Pedro Cabral, Researcher at the Federal Institute of Ceará
Posted
2 months ago
1090 Views
|
1 Reply
|
5 Total Likes
Follow this post
|
Simulating “Animal Crossing: New Horizons” Mendelian Flower Genetics in Mathematica
Pedro Cabral – Researcher, Data Scientist.
Introduction
In the video game
Animal Crossing: New Horizons
, by
Nintendo
, one interesting game mechanic is the ability of planting and breeding many species flowers. The game uses simple Mendelian genetics and many results can be obtained with the
Punnet square
and simple statistics. In this article, I define many useful functions for representing the flower genes, computationally breeding two flowers, and plotting and charting the
Punnet square
.
Understanding the Genes
Before starting the definition of the functions and breeding of the flowers, lets understand how exactly the genes present in the flowers work.
“Rr”
Controls whether a flower is
red based or not
. Red based flowers are
red
,
black
,
pink
, and
orange
. Non-red are
yellow
,
white
, and
purple
.
Note
: Not all flowers with the
“R”
gene will be red-based, since other genes can cover it, but a flower with the genes
“rr”
will never be red-based.
◼
“RR”
or
“Rr”
Red-based
.
◼
“rr”
Non-red.
“Yy”
Controls whether a flower
has any yellow in it
(yellow or orange)
.
◼
“YY”
or
“Yy”
Yellow or Orange
.
◼
“yy”
Non-yellow.
“Ww”
Controls whether a white flower
will be white
or
show its underlying color
:
either purple or blue depending on the species
.
Note
: White flowers are fairly
recessive
to most colors, so this gene will only have an effect if the white isn’t getting covered by
reds
,
yellows
, or other colors.
◼
“WW”
or
“Ww”
White
.
◼
“ww”
Purple or blue.
“Ss”
Controls
which shade the red-based flower will be
.
Pink
is the lightest shade,
red
is the middle, and
black
is the darkest. This gene has
no effect on non-red flowers
.
◼
“SS”
Pink
.
◼
“Ss”
Red.
◼
“ss”
Black.
Functions and Definitions
FlowerGene
Splits the gene into partitions of two. Useful on operations involving breeding and Punnet square.
I
n
[
]
:
=
F
l
o
w
e
r
G
e
n
e
:
:
i
n
v
g
e
n
e
=
"
F
l
o
w
e
r
g
e
n
e
m
u
s
t
c
o
n
t
a
i
n
8
a
l
l
e
l
e
s
.
"
;
I
n
[
]
:
=
F
l
o
w
e
r
G
e
n
e
[
g
e
n
e
_
S
t
r
i
n
g
]
:
=
M
o
d
u
l
e
[
{
s
t
r
=
S
t
r
i
n
g
R
e
p
l
a
c
e
[
g
e
n
e
,
"
-
"
"
"
]
,
p
a
r
t
}
,
(
*
C
h
e
c
k
i
f
t
h
e
r
e
'
s
8
a
l
l
e
l
e
s
.
*
)
I
f
[
!
(
S
t
r
i
n
g
L
e
n
g
t
h
[
s
t
r
]
8
)
,
R
e
t
u
r
n
[
M
e
s
s
a
g
e
[
F
l
o
w
e
r
G
e
n
e
:
:
i
n
v
g
e
n
e
]
]
;
]
;
(
*
P
a
r
t
i
t
i
o
n
i
n
t
o
g
r
o
u
p
s
o
f
t
w
o
.
*
)
p
a
r
t
=
S
t
r
i
n
g
P
a
r
t
i
t
i
o
n
[
s
t
r
,
2
]
;
(
*
R
e
t
u
r
n
t
h
e
s
p
l
i
t
t
e
d
a
l
l
e
l
e
s
.
*
)
R
e
t
u
r
n
[
S
t
r
i
n
g
S
p
l
i
t
[
#
,
"
"
]
&
/
@
p
a
r
t
]
;
]
;
I
n
[
]
:
=
(
*
E
x
a
m
p
l
e
u
s
a
g
e
:
*
)
F
l
o
w
e
r
G
e
n
e
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
O
u
t
[
]
=
{
{
R
,
R
}
,
{
y
,
y
}
,
{
W
,
W
}
,
{
S
,
s
}
}
FlowerColor
Returns the color for a given gene. This approach of determining a specific flower color is ad-hoc.
I
n
[
]
:
=
F
l
o
w
e
r
C
o
l
o
r
[
g
e
n
e
_
]
:
=
M
o
d
u
l
e
s
t
r
=
S
t
r
i
n
g
R
e
p
l
a
c
e
[
g
e
n
e
,
"
-
"
"
"
]
,
f
l
o
w
e
r
g
e
n
e
s
=
F
l
o
w
e
r
G
e
n
e
s
,
R
e
t
u
r
n
[
f
l
o
w
e
r
g
e
n
e
s
〚
s
t
r
〛
]
;
;
I
n
[
]
:
=
(
*
E
x
a
m
p
l
e
u
s
a
g
e
:
*
)
F
l
o
w
e
r
C
o
l
o
r
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
O
u
t
[
]
=
R
e
d
RandomFlowerGene
Generates a random flower gene.
I
n
[
]
:
=
R
a
n
d
o
m
F
l
o
w
e
r
G
e
n
e
[
]
:
=
M
o
d
u
l
e
[
{
}
,
R
a
n
d
o
m
C
h
o
i
c
e
[
{
"
R
R
"
,
"
R
r
"
,
"
r
r
"
}
]
<
>
R
a
n
d
o
m
C
h
o
i
c
e
[
{
"
Y
Y
"
,
"
Y
y
"
,
"
y
y
"
}
]
<
>
R
a
n
d
o
m
C
h
o
i
c
e
[
{
"
W
W
"
,
"
W
w
"
,
"
w
w
"
}
]
<
>
R
a
n
d
o
m
C
h
o
i
c
e
[
{
"
S
S
"
,
"
S
s
"
,
"
s
s
"
}
]
]
;
I
n
[
]
:
=
(
*
E
x
a
m
p
l
e
u
s
a
g
e
:
*
)
R
a
n
d
o
m
F
l
o
w
e
r
G
e
n
e
[
]
O
u
t
[
]
=
R
R
y
y
W
W
S
s
FlowerIcon
Returns an icon for a given color .
I
n
[
]
:
=
F
l
o
w
e
r
I
c
o
n
:
:
i
n
v
c
o
l
o
r
=
"
`
`
i
s
n
o
t
a
v
a
l
i
d
f
l
o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u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
Y
-
W
W
-
s
s
"
]
]
]
O
u
t
[
]
=
Breeding of “Seed” Flowers
(Parental Generation)
“Seed”
flowers are the
Parental Generation
flowers. In this case, only three different genes represents the
P Generation
. In this section, we will compute the breeding of three different parental flowers with distinct genes:
◼
Parental Red
RR
-
yy
-
WW
-
Ss
◼
Parental Yellow
rr
-
YY
-
WW
-
ss
◼
Parental White
rr
-
yy
-
Ww
-
ss
Breeding of
Parental Red
and
Parental Yellow
I
n
[
]
:
=
P
u
n
n
e
t
S
q
u
a
r
e
C
h
a
r
t
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
Y
-
W
W
-
s
s
"
]
]
]
O
u
t
[
]
=
I
n
[
]
:
=
U
n
i
q
u
e
G
e
n
e
s
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
Y
-
W
W
-
s
s
"
]
]
]
O
u
t
[
]
=
{
R
r
Y
y
W
W
S
s
,
R
r
Y
y
W
W
s
s
}
Breeding of
Parental Red
and
Parental White
I
n
[
]
:
=
P
u
n
n
e
t
S
q
u
a
r
e
C
h
a
r
t
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
R
R
-
y
y
-
W
W
-
S
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
y
y
-
W
w
-
s
s
"
]
]
]
O
u
t
[
]
=
I
n
[
]
:
=
U
n
i
q
u
e
G
e
n
e
s
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o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@
%
O
u
t
[
]
=
{
R
e
d
,
B
l
a
c
k
,
R
e
d
,
B
l
a
c
k
,
P
i
n
k
,
R
e
d
,
P
i
n
k
,
R
e
d
,
W
h
i
t
e
,
W
h
i
t
e
,
W
h
i
t
e
,
W
h
i
t
e
}
Breeding of
F
1
Yellow
and
F
1
White
One interesting trait of breeding
F
1
Yellow
and
F
1
White
is that no different color is produced in the result of the breeding.
I
n
[
]
:
=
P
u
n
n
e
t
S
q
u
a
r
e
C
h
a
r
t
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
y
-
W
W
-
s
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
y
-
W
w
-
s
s
"
]
]
]
O
u
t
[
]
=
I
n
[
]
:
=
U
n
i
q
u
e
G
e
n
e
s
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
y
-
W
W
-
s
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
r
r
-
Y
y
-
W
w
-
s
s
"
]
]
]
O
u
t
[
]
=
{
r
r
Y
Y
W
W
s
s
,
r
r
Y
Y
W
w
s
s
,
r
r
Y
y
W
W
s
s
,
r
r
Y
y
W
w
s
s
,
r
r
y
y
W
W
s
s
,
r
r
y
y
W
w
s
s
}
I
n
[
]
:
=
F
l
o
w
e
r
C
o
l
o
r
[
#
]
&
/
@
%
O
u
t
[
]
=
{
Y
e
l
l
o
w
,
Y
e
l
l
o
w
,
Y
e
l
l
o
w
,
W
h
i
t
e
,
W
h
i
t
e
,
W
h
i
t
e
}
“
F
2
” Flowers and Punnet Squares
Now, for the
F
2
flowers
, let’s plot their probabilities and their
Punnet squares
.
Tip
: You can hover your mouse over a flower to know its color, gene, and probability.
Breeding of
F
2
Pink
and
F
2
Black
I
n
[
]
:
=
P
u
n
n
e
t
S
q
u
a
r
e
C
o
l
o
r
s
[
P
u
n
n
e
t
S
q
u
a
r
e
[
F
l
o
w
e
r
G
e
n
e
[
"
R
r
-
y
y
-
W
W
-
S
s
"
]
,
F
l
o
w
e
r
G
e
n
e
[
"
R
r
-
y
y
-
W
W
-
s
s
"
]
]
]
O
u
t
[
]
=