Dishes Puzzle

I tried the guess and test method! I understood that I would need to determine the number of people there would need to be and that I would need to divide this number of people by 2, 3, and 4. Dividing by these numbers would have remainders or decimals though and so, I realized that I had to round down if I divided. I then attemped to guess some numbers starting at 100. Luckily, I was able to get it after the second guess! I then realized that I would also get the same result for 61.

Two answers: 60 and 61

>> test = 100;
>> a = floor(test/2);
>> b = floor(test/3);
>> c = floor(test/4);
>> d = a + b + c;

>> test = 60;
>> a = floor(test/2);
b = floor(test/3);
c = floor(test/4);
d = a + b + c;

Comments

Post a Comment

Popular Posts