Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 6. A group of monkeys

DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

DO SECOND PART ONLY PLEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

image text in transcribed

6. A group of monkeys have N bananas in day 1. In the next each day, these monkeys eat half the number of current bananas plus one more banana. When the number of the banana n is odd, its half is counted as the lower bound. For example, when 21, half of n should be 10, and 10+1=11 bananas will be eaten on this day. n = Write a program to compute the number of bananas N in the first day, based on the current day d and current number of bananas n. The input of the program should be the current day d and current number of bananas n, and the output of the program should be the number of bananas N in the first day. We assume that before day d, the number of bananas n in every previous day is even. For example, if in day 3 we have nz 12, then the number of bananas in day 2 should be na (n3 + 1) * 2 26, and the original number of bananas in day 1 should be N = n1 = (n2 + 1) * 2 = 54. (3 marks) = Without the assumption that before day d, the number of bananas n in every previous day is even, how many possible values are there for N? Express your answer with d or n or both, and explain why. (2 mark)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago