2.3. Exercises
2-1. | Prove, using mathematical induction, that the sum of the first N even integers is given by the formula
|
2-2. | Use mathematical induction to establish that the following formulae are correct:
|
2-3. | The year: 1777. The setting: General Washington's camp somewhere in the colonies. The Redcoats have been shelling the Revolutionary forces with a large cannon within the British camp. You have been assigned a dangerous reconnaissance mission—to infiltrate the enemy camp and determine the amount of ammunition available for that cannon. Fortunately for you, the British (being relatively neat and orderly) have stacked the cannonballs into a single pyramid-shaped stack. At the top is a single cannonball resting on a square of four cannonballs, which itself rests on a square of nine cannonballs, and so forth. Given your dangerous situation, you only have a chance to count the number of layers before escaping back to your own encampment. Using mathematical induction, prove that, if N is the number of layers, the total number of cannonballs is given by the equation
|
2-4. | Assuming that ... |
Get Thinking Recursively with Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.