Question
Preamble The single most important skill you can develop as a programmer is your ability to solve problems (followed very closely by no longer fearing
Preamble
The single most important skill you can develop as a programmer is your ability to solve problems (followed very closely by no longer fearing failure).
Problem solving, as a skill, consists of the following major components:
- An ability to identify the starting conditions
- An ability to identify the desired outcome(s)
- An ability to break everything between the starting condition and the desired outcome into smaller steps
The last of these three things is perhaps the most important, and often the trickiest. Consider the quandary a young Gauss faced when trying to create a function for consecutive integer summations. Iterating over every part of the summation can quickly become extremely time consuming (1+2+3++n). Yet Gauss was able to understand that given his starting condition of n and the desired outcome (a summation n integers sequentially), he was able to derive functional components (mathematical characteristics of the final function) that allowed him to understand that the following function would give him the answer to any summation he desired by only knowing n.
(n * (n+1)) / 2
In this programming assignment, you will play the role Gauss in that you will be asked to solve a problem (described in the scenario section below). This will not require any programming but will require you to demonstrate problem solving skills. In effect, you will be thinking like a programmer.
Scenario
You and two of your friends often play made up games when your bored at hanging out. Today, you think youve come up with a game that plays to your strengths (youre a great problem solver).
The only rules to this game are:
- The game consists of rounds where players each take a turn (order doesnt matter)
- Players start the game with a value of 1
- Each round each player can either add 1 to their value or double the value
- This choice is written down and only revealed to other players at the end of the round
- This cycle repeats until at a player reaches a predetermined number (this number can either be agreed upon by everyone or randomly selected in some way, but for the sake of a fun time and reasonably long game, youve required it to be greater than 400)
-
Your friends agree to play this game and everyone sits down, unaware that youve already figured out a strategy that ensures you NEVER LOSE.
Your Task
Describe a solution. To think like a programmer I recommend identifying any aspects of this problem that can be described with logical or mathematical concepts. You will also want to identify your starting condition and ending condition. Finally, consider any rules or constraints described in the problem you are solving. You are not required to write code for this assignment. You ARE required to carefully describe your solution (describing your thought process as you develop you solution can be very helpful).
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