Question: this problem has to be done using c-program. Problem 2: Count Bacteria Population A certain species of bacterium reproduces according to the following rules: -

this problem has to be done using c-program. Problem 2: Count Bacteriathis problem has to be done using c-program.

Problem 2: Count Bacteria Population A certain species of bacterium reproduces according to the following rules: - A bacterium born in day n does not give birth to new bacteria in day n and day n+1. - A bacterium born on day n gives birth to 1 bacterium on day n+2. - A bacterium born in day n gives birth to 2 bacteria in day n+k, for each k>2, i.e., a bacterium born in day n gives birth to 2 bacteria from the (n+3) rd day onwards. - A bacterium does not die. Let Pn denote the population of bacteria on day n. It is provided that P0=0 and P1=1. In this problem, n is given as input, you have to output Pn. For example, P2=1 because the bacteria born on day 1 does not replicate on day 2 . On day 3 , a bacterium is born of the 1 st bacteria. So, P3=2. On day 4,2 bacteria are born of the 1 st bacteria and none of the 2 nd. So, P4=4. Restrictions: Arrays cannot be used for this task. Use a recursive method with the following prototype

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!