Decision Making for Humans and Computers Why is decision making important?
This is an introduction designed to get you looking at code, getting familiar with syntax, and starting to think like a developer. The expectation is that you will NOT master any topics today! We will be covering these topics in much more detail in Mod1.
Decision Making, and Why It Matters
Other than very basic functions of staying alive (breathing, circulation, reflexes, etc…), we must make decisions in order to take action. Nearly everything you have done today has been the result of a decision: what should I eat for breakfast, what should I wear, where should I work. Without the ability to make decisions, we would be very uninteresting animals.
But, how do we make decisions? In general, we can break the decision making process down into 3 steps:
- Observation - taking in relevant data.
- Analysis - determining what is important about the data we have observed.
- Action - Doing something that logically follows the analysis.
For example, when determining what to wear we would:
- Observe the weather conditions by
- Looking outside to see if the sun is shining.
- Go outside to feel the temperature.
- Analyze our findings
- It is cold out.
- The sun is shining.
- Take action
- Wearing a coat.
- Leaving our umbrella at home.
It is important for us to understand how we make decisions so that we can create programs that are good at making decisions. Just like humans, computer programs need to make decisions in order to operate. Programs need to decide: which view should a user see, what should I do with the data a user gives me.
Different computers can perform different actions. A common action is for a computer to give a user some information. We call this
output. Output is the information that a program or computer gives to a user.
Work through the tutorial linked below to learn about how C# outputs information to users. Make sure to walk through each
Try it yourself section.
Computers make observations by receiving input. A computer only knows what we input into it; it has no other view of ‘the world’. To learn more about computer observations, work through the tutorials below. Make sure to walk through each
Try it yourself Section.
The final piece of decision making for computers, is an analysis of what to do based on the input it is given. We need to tell computers exactly what to do with any given piece of information. Learn more about computer analysis by working through the tutorials below. Make sure to walk through each
Try it yourself section.
Putting it all together
In order to create an interesting computer program, we need all three of the steps above to be working together.
Open this repl and complete the following:
- Fork the repl so that you have your own copy.
- Identify as many of the tools you learned about above as you can. Make a comment above each line where you see something you recognize. You may not recognize everything in this code - that’s ok!
- Run the program by clicking on the green play button!
Thinking Like a Developer
As a reminder, this session was intended to give you an introduction to some programming concepts - you are not going to master these things yet.
What you have started doing today is practicing what it is like to ‘think like a developer’. Developers must consider how decisions get made and how actions are taken in order to write programs. Developers break down decisions into small detailed steps, and then write the code to make those steps happen!
Your instructor will create a chat thread for each of the questions below; when you’re ready, add your reflection to the thread!
- What is one decision you made today - how did you Observe, Analyze, and Act on that decision?
- Imagine you are building a program to determine how much water to put into a swimming pool. What sorts of observations must be made before any water starts flowing?
- What questions do you have about computer decision making so far?