A boy goes to 20 of his friend’s houses with ‘n’ number of newly purchased marbles in his hands. At every house he visits , he gives away half of marbles he have and take one of his friend’s marble’s and adds it with the one’s he is left with , he never had a problem of dividing an odd number of marbles left and finally after leaving the his 20th friends house, he is left with 2 marbles, can you guess the ‘n’ value?
Answer:Â 2
Explanation:Â n=2;Â The boys purchases two marbles from the shop and travels to his first friend’s house,where he gives away half of them which is n/2=2/2=1 to his first friend ,and thereby left with 1 marble, and takes 1 marble from his first friend and adds it to the remaining he is left with, which is 1 ,therefore he is now having 2 marbles with him.
Then he goes to his second friend’s house and again gives away half of what he hive which is again 2/2=1 and he is left with 1 marble, and takes 1 marble from his second friend and adds it to the remaining he is left with, which is 1 ,therefore he is now having 2 marbles with him.
And in the same way he continues to all his friend’s houses and will return back with two marbles. So, Finally after he comes from his 20th friends house, he is left with 2 marbles.
This Puzzle is contributed by Harika Mulumudi. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape,
GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out -
check it out now!