The starting block below is CODE_PARENT
unit long.
The starting block below is CODE_PARENT
units long.
Use the tools below to convert the starting block into the goal block that is CODE_OFFSPRING
unit long.
Use the tools below to convert the starting block into the goal block that is CODE_OFFSPRING
units long.
The current block shows your progress.
Starting Block:
Current Block:
Goal Block:
The starting block has a length of CODE_PARENT
, which can be rewritten as:
\qquadPARENT_EXPANSION
+ fraction(N_PARENT - D, D_PARENT) =
fraction(N_PARENT_EXPANDED, D)
The goal block has a length of CODE_OFFSPRING
, which can be rewritten as:
\qquad
OFFSPRING_EXPANSION
+ fraction(N_OFFSPRING - D, D_OFFSPRING) =
fraction(N_OFFSPRING_EXPANDED, D)
fraction(N_PARENT_EXPANDED, D)
is the same thing as
N_PARENT_EXPANDED \times fraction(1, D)
.
Therefore, if we cut the starting block into N_PARENT_EXPANDED
equal pieces,
each piece will have a length of fraction(1, D)
units.
If we copy a piece N_OFFSPRING_EXPANDED
times, we will get a length of
N_OFFSPRING_EXPANDED \times fraction(1, D) = fraction(N_OFFSPRING_EXPANDED, D)
units.
Therefore the solution is to cut the starting block into N_PARENT_EXPANDED
pieces
and copy the resulting block N_OFFSPRING_EXPANDED
times.