There is a creature with many heads, one knight wants to kill it. He can cut 1, 7 or 11 heads off.
If there is any head left:
I) After cutting 1 head off, 4 heads will grow.
II) After cutting 7 heads off, 1 head will grow.
III) After cutting 11 heads off, 5 heads will grow.
Creature dies when there isn't any head left.
Can knight kill it
1.
If it has got 100 heads?
2.
If it has got 99 heads?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
In the first part of your solution, after the knight goes through the( 1 , 4 ) process once, the creature ends up with just 7 heads. After cutting off these 7, wouldn't one more grow? It seems logical that a head must replace the lost 7 as stated in the question.
Log in to reply
Good point, but note that in bold print we have "If there is any head left ....". So how I read this was, for example, "If there is any head left after cutting 7 heads off, 1 head will grow." So after cutting off the last 7 heads, since no heads remain, the creature is finally dead and no head will grow back.
Read the question again.
You can also notice that on a cutting where the creature hasn't died yet, the number of heads remains invariant mod three.
Therefore, you can kill it when it has 100 heads because you can cut off 1 mod 3 heads.
However you can't cut off a multiple of three number of heads therefore 99 is impossible.
Then you just find a possible cutting for 100 and you are done.
when it reaches to 4 heads,how cutting with (1,4) gives 7 heads ? Should not it again come back to 16 heads.
Log in to reply
When it reaches 4 heads, cutting off a head will leave 3 heads intact, which combined with the 4 new heads that grow back leaves the creature with 7 heads.
Log in to reply
fine,i was cutting all the heads once. Thanks. But still out approach is sort of trail based , I mean i am not sure whether i will be able to solve further questions like this with different set of data .
Log in to reply
@Aditya Duhan – It does depend on the specific data given, and there isn't any formula that works in all cases. However, for this problem, we know that a creature with a multiple of 3 heads can't be killed, but a creature with any other number of heads can be. When the number of heads is 1 ( m o d 3 ) then you can either first get to 7 heads left and then make the kill, or to 4 heads left and then follow the same method as outlined in the 1 0 0 head case.
When the number of heads is 2 ( m o d 3 ) then you can either get to 8 heads left, use a ( 1 , 4 ) step to get to 1 1 heads left and then make the kill, or get to 5 heads left and make two ( 1 , 4 ) steps to get to 1 1 heads left and then make the kill.
I would think that any question like this would be set up in a similar way, so that one could use modular arithmetic to make a full analysis of all the possible cases.
From 100: Whether you use (-11+5) or (-7+1) does not matter. Eventually you will get down to 4 (since 16 x 6 = 96). Then 4-1+4 = 7 and 7-7 = 0. From 99: Get down to 3 (one less than for the 100 case). Now, 3-1+4=6 and 6-1+4=9, 9-7+1=3 and the cycle will just repeat.
100 heads, so taking (11,5) function -> we continue until 16 times until we are left with 2 + 5 heads to which we apply (7,1) function once which gives 7 heads in the last stage which is finally carried out using function (7,1) .
Problem Loading...
Note Loading...
Set Loading...
If the creature has 1 0 0 heads, then one way the knight can proceed is as follows. Go through the ( 7 , 1 ) process, (i.e., 7 heads cut off, 1 head grows back), a total of 1 6 times, which will leave the creature with 1 0 0 − 1 6 ∗ ( 7 − 1 ) = 4 heads remaining. Now go through the ( 1 , 4 ) process once to end up with 7 heads remaining, which the knight can then cut off to finally kill the creature.
If the creature has 9 9 heads, then first note that as long as the creature is alive, the ( 1 , 4 ) process will increase the number of its heads by 3 , and both the ( 7 , 1 ) and ( 1 1 , 5 ) processes will decrease the number of its heads by 6 . Since the creature starts with 9 9 heads, which is divisible by 3 , and can only have its number of heads change (after one of the processes) by 3 or 6 while remaining alive, then while it is alive the number of heads it has after any of the three processes will always be divisible by 3 . But since none of 1 , 7 or 1 1 is divisible by 3 , the knight will never be able to deliver the final blow to kill the creature.
Thus the knight can kill a 1 0 0 -headed creature but not a 9 9 -headed one.