4
$\begingroup$

We have 3 type of flowers - red, white, pink.

We have to buy flowers to beautify the sidewalk in 5 weeks. The flowers fully develop in 1 week, but during another week flowers die out.

The flowers are crossing like this:
Red + Red = Red + Red + Red + Red
Red + White = Pink + Pink + Pink + Pink
Pink + Pink = Red + White + Pink + Pink
Red + Pink = Red + Pink + Red + Pink
...

Rules of crossing flowers in each week (in that order):
1. We cross half of red flowers with pink flowers
2. We cross half of white flowers between each other
3. We cross quarter of remaining pink flowers with white flowers
4. We cross remaining white flowers with red flowers
5. We cross half of remaining pink flowers between each other
6. We cross half of remaining red flowers between each other
7. We leave what remains

In 5 weeks we must have at least 84 red flowers, 63 white flowers, 105 pink flowers.

From each color we have to buy at least 1 flower. Purchased flowers on the beggining are just after of full development.
What is the minimum number of each color of flowers which we have to buy?

Edit: We always round up - I apologize for confusion

Hint:

White + White = White + White + White + White
White + Pink = White + Pink + White + Pink

$\endgroup$
  • $\begingroup$ What are the remaining two flower crossing results? White+White -> ?; and White+Pink -> ? $\endgroup$ – Dr Xorile Nov 13 '17 at 23:35
  • $\begingroup$ When we do half or quarter of what remains, do we round up or down? $\endgroup$ – Dr Xorile Nov 13 '17 at 23:37
  • $\begingroup$ I clarified the question - sorry for confusion $\endgroup$ – Snip3r Nov 14 '17 at 6:19
3
$\begingroup$

Edit: OP clarified that we should always round up. Then:

7 Red, 4 White, and 5 Pink lead to 89 Red, 77 White, and 138 Pink after 5 weeks.

I wrote a brief python program to run through the various possibilities. Of course, in principle, you are doubling the number of flowers each week, so it could be possible to start with as few as 8 flowers. However, with other configurations, we usually have too few red flowers.

Here are some examples of runs, where the first three numbers are the starting red, white, and pink flowers, and the last three numbers are the ending red, white, and pink flowers after 5 weeks.

1 1 1 9 25 32
1 1 3 17 33 52
1 2 2 15 45 50
1 3 2 15 47 50
1 2 4 18 52 60
3 2 2 44 38 64
3 1 4 46 40 70
3 3 2 38 50 72
4 3 1 48 48 74
4 1 4 61 39 78
4 2 3 59 43 78
2 4 4 24 76 82
3 2 5 44 56 94
4 3 3 55 55 88
4 2 5 65 59 96
5 5 1 50 70 110
3 4 5 35 83 116
4 3 5 66 74 110
5 3 6 71 73 120
4 3 8 68 82 118
4 4 7 56 88 130
4 6 5 42 108 146
5 7 4 42 112 148
7 4 5 89 77 138

Hopefully, this is correct. Coding errors are always possible in this kind of thing. For auditing purposes, here's my view on the R,W,P over the course of 5 weeks:

7 4 5
12 6 14
22 12 24
37 23 44
59 43 78
89 77 138

And here is a single week with all the steps. I am showing the R,W,P,R2,W2,P2 for the number of roses left from the previous week and the number of roses we will have for the next week. I also have Step n: R,W,B showing how many roses are involved in each step:

7 4 5 0 0 0
Step 1: 4 0 4
3 4 1 8 0 8
Step 2: 0 2 0
3 2 1 8 4 8
Step 3: 0 1 1
3 1 0 8 6 10
Step 4: 1 1 0
2 0 0 8 6 14
Step 5: 0 0 0
2 0 0 8 6 14
Step 6: 1 0 0
0 0 0 12 6 14

$\endgroup$
  • $\begingroup$ I clarified the question - sorry for confusion $\endgroup$ – Snip3r Nov 14 '17 at 6:19
  • $\begingroup$ No problem. Note, we cannot always round up. For example, if there is only 1 pink flower at step 5, then we cannot cross it. If there are 2, then we will cross them both using the rounding up method. $\endgroup$ – Dr Xorile Nov 14 '17 at 20:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.