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 both of the goal blocks that are
CODE_OFFSPRING_1
units long and CODE_OFFSPRING_2
units long.
The current blocks show your progress.
Starting Block:
Current Block 1:
Goal Block 1:
Current Block 2:
Goal Block 2:
We want to cut the starting block into a piece that can be copied into both goal block 1 and goal block 2.
The least common denominator of D_OFFSPRING_1
and D_OFFSPRING_2
(the denominators of the goal blocks) is LCM
. Therefore you can copy a block
\dfrac{1}{LCM}
units long to make both goal blocks.
The starting block has a length of CODE_PARENT
, which can be rewritten as:
\qquadfraction(D_PARENT, D_PARENT) + fraction(N_PARENT - D_PARENT, D_PARENT) =
fraction(N_PARENT, D_PARENT)
We can rewrite the starting block length in terms of \dfrac{1}{LCM}
units:
\qquad fraction(N_PARENT, D_PARENT) \times fraction(PARENT_MULTI, PARENT_MULTI) =
fraction(SLICES, LCM)
If we cut the starting block into SLICES
equal pieces,
each piece will have a length of fraction(1, LCM)
units.
Goal block 1 has a length of CODE_OFFSPRING_1
units, which can be rewritten as:
\qquadfraction(D_OFFSPRING_1, D_OFFSPRING_1) + fraction(N_OFFSPRING_1 - D_OFFSPRING_1, D_OFFSPRING_1) =
fraction(N_OFFSPRING_1, D_OFFSPRING_1)
We can rewrite the goal block 1 length in terms of \dfrac{1}{LCM}
units:
\qquad fraction(N_OFFSPRING_1, D_OFFSPRING_1) \times fraction(OFFSPRING_1_MULTI, OFFSPRING_1_MULTI) =
fraction(OFFSPRING_1_MULTI * N_OFFSPRING_1, LCM)
If we copy a piece of length \dfrac{1}{LCM}
units OFFSPRING_1_MULTI * N_OFFSPRING_1
times
we get fraction(OFFSPRING_1_MULTI * N_OFFSPRING_1, LCM)
units, which is the length of goal block 1.
We can rewrite the goal block 2 length in terms of \dfrac{1}{LCM}
units:
\qquad fraction(N_OFFSPRING_2, D_OFFSPRING_2) \times fraction(OFFSPRING_2_MULTI, OFFSPRING_2_MULTI) =
fraction(OFFSPRING_2_MULTI * N_OFFSPRING_2, LCM)
If we copy a piece of length \dfrac{1}{LCM}
units OFFSPRING_2_MULTI * N_OFFSPRING_2
times
we get fraction(OFFSPRING_2_MULTI * N_OFFSPRING_2, LCM)
units, which is the length of goal block 2.
Therefore the solution is to cut the starting block into SLICES
pieces, copy current block 1
OFFSPRING_1_MULTI * N_OFFSPRING_1
times and current block 2
OFFSPRING_2_MULTI * N_OFFSPRING_2
times.