essay
I399 – Problem solving Techniques
Week 2
Today
Algorithms
Inferences
ALGORITHMS
P a r t 1:
D e f i n i t i o n s
Algorithms
An algorithm is a finite set of precise instructions for performing a computation or solving a problem.
Algorithms are your friend
Not the terrifying things that Hollywood sometimes portrays them as
Just a way of clearly defining how to do something
Makes accomplishing tasks easier
Start with the action
State what you want to accomplish (goal)
Determine starting point
Think through each step you would need to take to get from start to goal
Record each step
The action continued
Try going through the steps one-by-one looking for places where you could be more specific or where you end up diverging from your intended result
Test results
Repeat until satisfied with algorithm
Directions to a robot chef
Algorithms are like recipes
You have a series of detailed steps that lead you from beginning to finished product
think of a set of directions you could give to a robot chef
It’s very good at doing what you tell it
Not good at original thinking
P a r t 2:
W a l k t h r o u g h
First Attempt
Have: kitchen, eggs, milk, butter
Goal: scrambled eggs
prepare eggs in bowl
whisk ingredients
heat pan
add ingredients to pan
wait till cooked
put on plate
Refining a Step
heat pan
Set control for empty burner to medium
Place pan on burner
Place 2 teaspoons of butter in pan
Wait until surface temperature of pan is 165 degrees Fahrenheit
How did I get there?
State what you want to accomplish (i.e. make scrambled eggs)
Determine starting point (have kitchen, ingredients)
Think through each step you need to take to get from start to goal
Record each step (our first pass)
Try going through the steps one by one looking for places where you could be more specific or you end up diverging from your intended result (we started doing this with step 3: heat pan)
Test results (We haven’t built our robot, yet. We can imagine though.)
Repeat until satisfied with algorithm
P a r t 3:
E x p l o r a t i o n
Expectation
For today:
Write out all steps of your algorithm
Include your initial thoughts and refinements
Group Activity
What if we wanted to…
find the capital of Iceland?
Create at least one algorithm to solve this question
Solution
One example:
Wikipedia
Find device with internet browser
Navigate to Wikipedia
Enter “Iceland” into search bar
Look through the results web page to find where it states Iceland’s capital
A similar problem
How would I send a message to a friend?
One way:
Get a phone
Call friend
Wait for them to pick up
Tell them the message
Other approaches:
text, email, singing telegram
Comparing
Many right solutions, but that doesn’t mean we can’t meaningfully compare them:
Number of actions required
Other costs
Activity: bead sorting
You have a bag containing two colors of beads before you:
Come up with an algorithm for figuring out which color has more beads, or if they have the same number.
Suggestion: feel free to perform the activity yourself and see what steps you take
Experiment with different approaches
Activity: bead sorting
What approaches did you come up with?
Did you find some to be faster or slower than others?
How accurate were your results?
Activity: Search
Write an algorithm for finding position first occurrence of thing in a list or indicating if it can’t find a match
Example list:
2, 7, 4, 3, 6, 9, 8, 1
Starting with 1, what is the position of 6?
Activity: Search one solution
Set position to 1
Is there a item at position? If not, return 0
If yes, check item at position to see if it's our target
If yes, return position
If no, add 1 to position and return to Step 2
Recap
Algorithms are like developing a recipe for a robot chef.
Iteration and refinement are key
Tasks are easier once you have a plan
INFERENCES
P a r t 1:
T e x t
Inferences
Making logical conclusion based on evidence
beyond the evidence at hand
27
often introduced through reading
The young woman walked a bit hesitantly towards the famous cozy Italian restaurant. She did not believe the excuse her parents gave her for having to meet her at the restaurant instead of at their house. To make matters worse, she was a bit grumpy because she was still catching up on the sleep that she lost during exam time. She noticed some cars that looked familiar in the parking lot. As soon as she walked through the door, she heard, "Surprise!"
text
neither beginning nor end
P a r t 2:
I m a g e
Activity
human/machine
P a r t 3:
M e m e
Activity
a meme
of your own
what did you infuse the memes with
what you bring
v
what you observe
P a r t 4:
A c t i o n
break things down
detail every facet
write!
don't give up
find one more detail
ask good questions
how does it relate?
P a r t 5:
T h e M i n d
find your scaffolds
you're already doing so
just make it explicit in your mind
cognitive schema
what frames are most relevant
right now
implicit bias
P a r t 6:
G r o u p
Meier and Spada
don’t be afraid to share your unique knowledge
look for things that “belong” together
finding collaborative inferences is hard
but ultimately rewarding
P a r t 7:
C u l m i n a t i o n
elaborate on tools available
brainstorm possibilities
rule out
what do you know
Group
Murder Mystery
Group
“We know it was not Ed Puckett. You saw Louie alive after Ed left the dressing room and wandered into the shoe department. It wasn’t George Whitley, either, because he came straight to you from the shoe department, placed his order at the cash register, and left. The same goes for Gene Roberts, as you said he never entered the fitting area.” Pausing for a moment, he added, “The videotapes confirm everything you have told me.”
Journal