Categories
Uncategorized

Lockdown Challenge – Fighting Ducks

David Hunt, PGCE Computer Science Subject Leader in the School of Education,has provided another puzzle for colleagues to grapple with over the weekend, based on a computer coding-style challenge.

The solution is at the bottom of the page.

Mr Anaso runs the ‘hook-a-duck’ stall at the fairground. In each new town he sets up the stall with inflatable paddling pools where the ducks can bob around happily waiting to be hooked. He finds his job a bit boring but he has a sharp mind, so he thinks up a challenge when placing the ducks in the pools. Each of the ducks has a number painted on its underside and he decides he cannot place a duck in a pool if it’s number can be made up from any two other duck numbers already in the pool (in his vivid imagination, he thinks they might start fighting). He is very organised and he takes the ducks in number order when setting them up. He looks at the duck number and starts by trying to place it in pool_1. If this is not possible, he goes to the next pool and tries again – the pools are very cheap to buy and he has plenty of spare ones to use. He tries to see if he can place his ‘fighting ducks’ in the pools using twenty ducks to start with.

He gets started: duck_1 and duck_2 can be placed in the first pool but duck_3 needs to be in a separate pool (because 3 = 1 +2)

Pool Number Duck Number
Pool_1 1, 2
Pool_2 3

Mr Anaso is very good at mental arithmetic and he can quickly work through the sums he has to calculate in order to see if he can place a duck in a pool. The problem occurs when he has a lot of ducks bobbing around in the water and he can quickly lose his place and forget which combinations of ducks he has already added up.

Challenge

With each new duck, he tries to place them in the first pool. If that is not possible, he tries to see if it can work for the next pool. Once he has placed them, he doesn’t want to waste any time rearranging them, so they stay where they are. Starting with 20 ducks, can you calculate how many pools he needs to inflate, to ensure that none of his ducks get into a fight?

Killer Question

This time there must be a combination of three other ducks that add up to the same number as the one being placed for there to be a fight.

Clue: In this case, duck_4 could be placed with 1,2,3 but duck_6 could not.

If he is required to accommodate 100 ducks, how many will be placed in the first pool?

 

Answers:

Answer = 4 pools 

Pool Number Duck Number
Pool_1 1,2,4,7,10,13,16,19
Pool_2 3,5,6,12,14
Pool_3 8,9,11,15,18
Pool_4 17,20

Answer to Killer Question = 26 in the first pool

Pool Number Duck Number
Pool_1 1,2,3,4,5,13,14,15,25,26,27,37,38,48,49,50,60,61,71,72,73,83,84,94,95,96
Pool_2 6,7,8,9,10,11,12,16,17,18,19,20,58,59,62,63,64,65,66,67,68,69,70
Pool_3 21,22,23,24,28,29,30,31,32,33,34,35,36,39,40,41,42,43,44,45,46,47,51,52,53,

54,55,56,57

Pool_4 74,75,76,77,78,79,80,81,82,85,86,87,88,89,90,91,92,93,97,98,99,100

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.