Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help thanks! 6. 5 persons (called as A, B, C, D, and E) go out fishing, and collect all the fishes in one basket.
Please help thanks!
6. 5 persons (called as A, B, C, D, and E) go out fishing, and collect all the fishes in one basket. In the second day, the person A first wakes up. He discards one fish, and the rest fishes are exactly divided into 5 groups. Then, A takes away one group of fishes, and leaves the rest 4 groups. Then, person B wakes up, and he takes the left 4 groups of fishes as all the fishes remain. Similarly, he discards one fish, and the rest finishes can still be exactly divided into 5 groups. Then, C, D and E all repeat the same process: (1) discard one fish from the current number of fishes he saw, (2) divide the rest fishes (after discarding one fish) exactly into 5 groups, and take away one group. Everytime after discarding one fish, the rest fishes can exactly be divided into 5 groups. What is the smallest number of fishes that meets the requirement? Write a C programs to find the result by using iteration. (1 mark) Write another C program to solve the above question by using recursion. (1 mark) What is the smallest number of fishes that meets the requirement, when the number of people is 3 and 4, respectively? Use your program to find out. (1 mark) Intuitively, to find the smallest number of the fishes, the number of fish that the last person sees should be minimized. For example, when the number of people is N, the last person should always see N+1 fishes. Please use a specific case to prove that such intuitive conclusion is not correct, and explain why. (1 mark) 6. 5 persons (called as A, B, C, D, and E) go out fishing, and collect all the fishes in one basket. In the second day, the person A first wakes up. He discards one fish, and the rest fishes are exactly divided into 5 groups. Then, A takes away one group of fishes, and leaves the rest 4 groups. Then, person B wakes up, and he takes the left 4 groups of fishes as all the fishes remain. Similarly, he discards one fish, and the rest finishes can still be exactly divided into 5 groups. Then, C, D and E all repeat the same process: (1) discard one fish from the current number of fishes he saw, (2) divide the rest fishes (after discarding one fish) exactly into 5 groups, and take away one group. Everytime after discarding one fish, the rest fishes can exactly be divided into 5 groups. What is the smallest number of fishes that meets the requirement? Write a C programs to find the result by using iteration. (1 mark) Write another C program to solve the above question by using recursion. (1 mark) What is the smallest number of fishes that meets the requirement, when the number of people is 3 and 4, respectively? Use your program to find out. (1 mark) Intuitively, to find the smallest number of the fishes, the number of fish that the last person sees should be minimized. For example, when the number of people is N, the last person should always see N+1 fishes. Please use a specific case to prove that such intuitive conclusion is not correct, and explain why. (1 mark)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started