Independent Consultant Hands-on So*ware Architect Published Author / Conference Speaker Mark Richards h<p://www.wmrichards.com h<ps://www.linkedin.com/in/markrichards3 @markrichardssa The Art of Problem Solving
IndependentConsultantHands-onSo*wareArchitectPublishedAuthor/ConferenceSpeaker
MarkRichards
h<p://www.wmrichards.comh<ps://www.linkedin.com/in/markrichards3@markrichardssa
The Art of Problem Solving
step 1: understand the problem
step 2: devise a plan
step 3: carry out the plan
step 4: looking back
step 1: understand the problemwhat is the unknown? what are you trying to solve?what are the data, conditions, and constraints?can you draw a figure or diagram of the problem?can you break the problem down into separate parts?
step 2: devise a planhave you seen this problem (or a related one) before?can you restate the problem?can you solve part of the problem?can you solve it by removing or changing part of the condition?what can you derive from the available data?
can you prove that the result is correct?did you use all of the available data?did you use the whole condition?did you apply all of the constraints?
step 3: carry out the plan
can you check the result ("do the math")? does it make sense?
can you derive the results differently?can you see it at-a-glance?
step 4: looking back
a bear, starting at point P, walked one mile due south. then he changed direction and walked one mile due east.
then he turned again to the left and walked one mile due north, arriving exactly at the point P he started from.
what color was the bear?
one of the most important steps in solving a complex problem is drawing a visual representation
set 1 set 2 set 3 set 4 36 1 1 3 18 2 1 2 12 3 1 2 9 4 1 1 9 2 2 4 6 6 1 6 6 3 2 1 4 3 3 2
how old are my three sons?two friends meet after not seeing each other for a long time. one friend tries to guess how old the other friend's three sons are...
friend 2: "I can guess their ages, but I will need some information first"friend 1: "okay - the product of their ages is 36"friend 2: "hmm, I will need some more information"
friend 2: "I almost have it. however, I will need just one more piece of information"
friend 2: "I know the ages of your sons"
friend 1: "okay - sum of their ages is equal to the number of windows in that building"
friend 1: "okay - my oldest son has blue eyes"
friend 1: "all 3 of my sons celebrate their birthdays today. can you guess their ages?"
the product of their ages is 36the sum of their ages is equal to the number of windows in that building over there
facts
the oldest son has blue eyes
son 1 son 2 son 3 36 1 1 18 2 1 12 3 1 9 4 1 9 2 2 6 6 1 6 3 2 4 3 3
son 1 son 2 son 3 windows 36 1 1 38 18 2 1 21 12 3 1 16 9 4 1 14 9 2 2 13 6 6 1 13 6 3 2 11 4 3 3 10
9
2
2
limiting assumptions
“we don’t have the time to
implement that feature”
can the solution be
done quicker or iterated?
limiting assumptions
“we don’t have enough budget to
implement that feature”
can i find more money? can i
produce a cheaper solution?
limiting assumptions
“there are laws preventing us
from doing that”
can the law be changed, broken, or re-interpreted?
a man ordered a glass of red wine and white wine at a bar. He took the glass of white wine in his right hand and the one with red in his left hand and drank both.
the next day, he did the same. when he was leaving, the bartender asked him:
"i didn't know that firemen drank that way."
how did the bartender know he was a fireman?
WITHOUT MAKING
ASSUMPTIONS WE CANNOT
SOLVE THE PROBLEM!
"i didn't know that firemen drank that way."
using the right representation and modelwhen solving real-world problems, you have to
first create a model
the size of the solution space is not determined by the problem - it's determined by the representation
remember - every model leaves something out!
when projecting a map of the earth, only one of the four basic characteristics is preserved (distance, direction, shape, or area):
equirectangularmercator azmulthial mollweide(shape) (direction) (area) (distance)
there are six matches on the table
construct 4 equilateral triangles where the length of each side is equal to the length of each match
do not break the matches (leave them the length that they are)
using the right representation and model
often times you need to invent a starting point...
complex problems often contain an enormous number of possible solutionstake a first step, even though there doesn't seem to be a clear directioninvent a starting condition and retry until it establishes a clear directionmonte carlo simulation is one of these techniques
performance troubleshooting
root cause analysis for production problems
solving complex design and coding problems
often times you need to invent a starting point...
mr. smith and his wife invited four other couples for a party.
once everyone arrived, some of the people in the room shook hands with some others.
of course, nobody shook hands with their own spouse and nobody shook hands with the same person twice.
after that, mr. smith asked everyone how many times they shook someone's hand. he received different answers from everybody.
how many times did mrs. smith shake someones hand?
mr. smith
data: there were nine other people in the room, and each answer was different
0
1
2
3
4
5
6
7
8
mr. smith
draw a visual representation of the handshakes, starting with lowest to highest
0
1
2
3
4
5
6
7
8
mr. smith
start over again and keep going, but this time from highest to lowest...
0
1
2
3
4
5
6
7
8
mr. smith0
1
2
3
4
5
6
7
8
4 is mr. smith's spouse
--> 4 handshakes
can we infer anything from the diagram at this point???
"I can remember the very spot in the road, whilst in my carriage, when to my joy the solution occurred to me."
the Hungarian-American physicist Leo Szilard came up with the concept of nuclear chain reactions while waiting for the red light to change at a pedestrian crossing outside London’s British Museum
American electrical engineer Harold Black came up with the idea of a negative feedback amplifier while taking a ferry ride to work across the Hudson river in NYC.
perception can be realityoften times the best way to solve a problem is to not solve the root cause of the problem, but create the
perception that you solved the problem