There are 4 brothers who are to greedy and they have a dog and a bottle of cookies. The first brother wakes up at night and goes to the kitchen and does the next thing.
Firstly, he gives a cookie to the dog and secondly he eats the 4th part of the cookies that are left. nd he comes back to bed. After this the second brother wakes up and does the same thing, what it means that he gives one cookie to the dog and the eats the 4th part of the cookies that are left.
The third brother does the same thing and the 4th brother too. The next day when they are going to take the breakfast(the 4 brothers), first they give 1 cookie to the dog and after they divide the cookies that are left in equals parts(by 4).
The question is how many cookies there were in the bottle? I have to solve this problem by natural language, and a type of logic that is a mixture of predicate logic and mathematical logic, could somebody help me , please? Thank you
There exist an x such that -6 + (1/4)*(-1 + (1/4)*(-1 + (1/4)*(-1 + (1/4)*(-1 + x)))) = 0
Hans
0
Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.
If you allow negative cookies, -3 is a trivial answer,
Also, since you divide by 4 5 times, the difference between any two solutions must be a multiple of 1024
0
HansMichelCommented:
Hi.
This turned out to be a more interesting question than I previously thought. As for how to put this in formal logic or natural language I can't help right now. Disregard my last reply; because when I plug in 1621 back into the equations I end up with Reals or fractional parts for the brothers.
Brother 1 = 1620/4 = 405
Brother 2 = 404/4 = 101
Brother 3 = 100/5 = 25
Brother 4 = 24/4 = 6
Next Day
5/4 = 1.25 cookies for the brothers each. Nothing wrong with that except that you have fractional cookies for the brothers. Dog always gets 1.
ozo's first solution
Brother 1 1020/4 = 255
Brother 2 254/4 = 63.5
Brother 3 62.5/4 = 15.625
Brother 4 14.625/4 = 3.65625
Next Day
2.65625/4 = 0.6640625
But if you assume no negative cookies, no fractional cookies, or imaginary cookies for any one. Then the problem becomes more elagant and also interesting.
So x is 1365
1364/4 = 341
340/4 = 85
84/4 = 21
20/4 = 5
4/4 = 1
Now the sequence {0,1,5,21,85,341,1365, ...} is a very interesting sequence.
a_n = (4^n - 1)/3
If one brother got up again and gave the dog one cookie and took 1/4 the remainder then there would have been 5461 cookies.
What is interesting about this sequence is that if you represent these number is negabinary or binary they are equivalent.
{0,1,101,10101,1010101,101010101,10101010101, ...}
Natural language(?, well as natural as possible):
The number of cookies at each stage is one more than a multiple of 4, which is the same thing as saying it's 3 LESS than a multiple of 4.
Considering one brother: when he opens the jar it contains 4*X-3 cookies. He gives a cookie to the dog, leaving 4*X-4 (easily seen to be divisible by 4). He eats a quarter of these, leaving three quarters, (3/4)*(4*X-4) = (3/4)*X - 3, which is the same form as the original number.
Let's choose a number F, which is some multiple of 4, such that the original number of cookies in the jar is F-3. After each brother has done his bit, the number of cookies in the jar must be 3^4*F/4^4 - 3. In the morning they give one to the dog, leaving 3^4*F/4^4 - 4. This is divisible by 4 if F = 4^5 (= 1024).
Brother #1 finds 1021, gives one to the dog, eats 255, leaving 765
Brother #2 finds 765, gives one to the dog, eats 191, leaving 573
Brother #3 finds 573, gives one to the dog, eats 143, leaving 429
Brother #4 finds 429, gives one to the dog, eats 107, leaving 321
In the morning, they find 321, give one to the dog, and each eat 80 cookies.
They must be pretty stupid brothers not to notice the difference between 1021 and 321.
This is a slight variation on one found earlier here involving 5 sailors, a mass of coconuts and a monkey.
In the morning each brother eats n cookies and the dog 1. This adds up to:
4*n + 1
before breakfast. When the 4th brother entered the kitchen at night, there were therefore:
(4*n + 1)*4/3 + 1
cookies. This multiplication by 4/3 and addition of the cookie for the dog must be repeated 3 more times (one for each brother) in order to obtain N, the initial number of cookies in the jar.
This means that N is given by:
N = (n*4^5 + 4^4 + 4^3*3 + 4^2*3^2 + 4*3^3 + 3^4) / 3^4 ==>
N = (1024*n + 781)/81 ==>
N = n*1024/81 + 781/81
81 fits 9 times into 781, with a remainder of 52. Therefore:
N = n*1024/81 + 52/81 + 9 ==>
N = 4*(n*256/81 + 13/81) + 9
81 fits 3 times into 256, with a remainder of 13. Therefore:
N = 4*(3*n + (n + 1)*13/81) + 9
It is now clear that all solutions are obtained when (n+1)/81 is integer:
n = k*81 -1
The first solution is therefore, consistently with other proposed solutions, n = 80 and N = 1021. The next solution is n = 161 and N = 2045...
Well, I find that you should also recognise those who have given an explanation for the results, like in:
N = 4*(3*n + (n + 1)*13/81) + 9
It is now clear that all solutions are obtained when (n+1)/81 is integer:
n = k*81 -1
The first solution is therefore, consistently with other proposed solutions, n = 80 and N = 1021. The next solution is n = 161 and N = 2045...
Without making names... :-)
0
Featured Post
Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.