Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

2.1.3 Hodder

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

2.1.

3 Chapter 3
Problem solving
Introduction
Life makes us solve problems. We encounter problems every day and often solve them without thinking or maybe put them to the back of our mind and ignore them. We do
all this pretty much instinctively. Sometimes our instincts work well for us. A lot may depend on past experience. If we use past experience then we are saving effort because
we have solved a similar problem before.

Problem 1
I want to pave my patio. It is 11.5 m by 5.5 m. The paving slabs I want are square with a side length of 50 cm. I need to find out how many to buy.

Solution:
• Divide the patio side length by the slab side length.
• Repeat for the breadth.
• Multiply the two results.
That’s a nice simple process. I could code that if I wanted, or even do it in my head or on paper. I would have confidence that the answer is correct – as long as I chose the
right steps.

Problem 2
I have an urgent appointment – I have to be at the airport in two hours but before I can go, I have to take the cat to the boarding cattery. It is unthinkable that I can go away
for two weeks and leave her alone in the house. But disaster strikes – she is nowhere to be found. Maybe I will have to cancel my trip.
What can I do?
Solution 1: Panic
This sometimes works. I can rush around the house calling ‘here cat … come on’. But she’s wise to this. She knows she’s going to be put in a box and taken away from her
comfy hidey-hole. So I shake a bag of treats – that usually works. But she knows what’s going on and values being left alone more than she values the treats, so no good.
I then rush from room to room. I check the usual places, on the window ledges, under the beds. No good. What about the cupboard under the
stairs? She never goes there but you never know. Maybe she snuck out the front door when I packed the car.
During all this time, my blood pressure rises and the cat is calmly licking herself behind the one curtain that I didn’t check. There must be a
better way.
Solution 2: Plan ahead
Next time I’ll get the cat sorted the day before. So, when it is time to go to the airport, that is one problem less to worry about and I’ll be calmer and more likely to make my
flight. That’s the benefit of thinking ahead.
Questions
1. Is Solution 2 a good one? Might there be a better one?
2. Is this problem solvable by using computational methods?

Problem 3
I have to write a chapter on solving problems and the deadline is fast approaching. What can I do?

Solution 1: Put it off and hope the problem will go away


The trouble is, this rarely happens. Sometimes at work, your boss asks for a report and you know that if you stall, he’ll probably forget about it. Now, that is a rational
approach to saving effort. Some problems aren’t worth bothering with. But the book deadline? It might not be a good idea to try with that one. Who knows, maybe someone
will buy the book and it will be a success.
Question
A salesman lives in Birmingham. He has a week to visit clients in London, Zurich, Amsterdam and Manchester. How can he achieve this?
1. What data does he need?
2. How does he make a decision?
3. Is there a right or even a best answer?
Solution 2: Plan ahead
Before you can write a decent chapter, you need to marshal your ideas. This involves a lot of reading and research. These ideas need to be sifted – some ideas turn out to be
interesting, others, on reflection, look less good. Organise them, write them down or, better, use a computer to record them.
Decide what’s important and what is not. This is how we solve computational problems too.
Question
Getting divorced is one of the most stressful and, often, expensive processes anyone can go through. If you do marry, what strategies can be applied to marry someone who is
as suitable as possible?
Hint: there actually is a mathematical approach to this!
The world is full of problems for us to solve. Some are easy to solve and some are impossible. We use various strategies and approaches to solve them. Sometimes these
strategies are obvious; sometimes they are completely obscure. Sometimes we can be confident of our solutions, other times we remain in doubt even after applying them.
Some problems simply have no solutions. Some problems might be partly solvable by systematic and logical methods backed up by hunches. Which problems are which?
Problem solving does not always have to be the hit-and-miss business that we often make it. Needless to say, many great minds have been
applied to the problem-solving approach and one particularly notable investigator was the Hungarian mathematician George Pólya. He wrote
widely about problem solving, often making use ofheuristic approaches.
Key term
Heuristic An approach to problem solving that makes use of experience. It is not guaranteed to produce the best solution but it generally will
produce a ‘good enough’ result. Heuristic methods are sometimes referred to as a ‘rule of thumb’.
It is important to realise when ‘good enough is good enough’ and when it isn’t.
Example
You want to cross a busy road. There is no official crossing point. How do you make the decision about when to go for it?
This is a classic problem for heuristics. You don’t have the time or the equipment to measure the speeds of oncoming vehicles (unless you are operating a speed trap) and
even then you don’t know if a car will stop or speed up or if that cyclist turning right has seen you. You take in as many items of information as you can about rough speeds,
locations and even driving behaviour (is that lorry driver talking on his phone?). Your brain processes this at lightning speed, matches the inputs (roughly) with previous
attempts to cross roads and you choose your moment.
George Pólya listed four stages that you should go through when solving a problem (if you have time, that is).

1. Understand the problem


• What do we know about the problem?
• Can you restate the problem in your own words?
• What are the unknowns?
• What data do we have?
• What data do we need but don’t have?
• What data do we have but don’t need for solving the problem?
• Is it possible to come to a solution?
• Is it possible to partially solve the problem?
• Can the problem be divided into separate sub-problems? This is called ‘problem decomposition’ and is one of the essential aspects
of computational thinking.
• Can we represent the problem abstractly, with a diagram or variables?
Example
‘There are known knowns. These are things we know that we know. There are known unknowns. That is to say, there are things that we know we don’t know. But there are
also unknown unknowns. There are things we don’t know we don’t know.’
Donald Rumsfeld, speaking to a US Department of Defense news briefing in February 2002

2. Devise a plan
Think about whether you have seen this problem or a similar one before. You might be able to recycle ideas.
• Start breaking the problem into solvable sub-problems.
• Make a list of things you need to do.
• Look for patterns.
• Be creative – think ‘outside the box’. Use intuition. Remember – anyone can be creative. Be brave enough to question received wisdom. But also
remember that you have a particular problem to solve – solving others is not the point.
• Is there a formula or equation that can help?
• Try solving a similar problem if the real one is looking a bit too difficult at the moment.
Question
Can you think of any decisions or strategies made by governments or the management of your own institution that have been obviously bad but were persisted with?
While you are thinking about this, look up ‘NHS IT System’. This is one of the most notorious IT failures ever and Chapter 9 also looks at this.

3. Carry out your plan


Do this carefully, checking as you go.
Are you sure that each stage is in fact correct?
If your plan isn’t working out then don’t be afraid to abandon it and start again. If you are in a hole you don’t keep digging.

4. Look back over what you have done


Once you have a solution, it is tempting to tick the box that says ‘done’ and forget about it. Often a solution can be improved. A question computer scientists should ask when
they have devised an algorithm is ‘could this be done better?’ We are used to having better and faster computer systems all the time. Not all of the progress is down to better
and faster hardware. Much of the improvement is due to better algorithms.
1. You might have got so involved in the detail that you have overlooked the big picture.
2. Could you have done this differently?
3. Have you learned something that you can apply to future problems?
Key points
– Problems come in all shapes and sizes.
– Some problems are unsolvable.
– Problems can often be solved adequately by heuristics.
– There are well-defined processes that help to solve problems.
Practice questions
1. How could you use a laptop to determine the height of a building? Think of as many answers as you can.
2. Town A has 100 school-age children living in it. Town B has 50. There are plans to build a new school to serve them all. How would you go
about finding a location for the school that minimises the total distance travelled by all the children?
3. To what extent are heuristic methods of problem solving appropriate for the following scenarios:
(a) scanning a hard drive for virus signatures
(b) using light reflectivity on dirty washing to determine which wash cycle to use
(c) setting the grade boundaries in A level exams (the mark where A becomes B, and so on)
(d) setting a safe altitude for an aircraft when flying over mountainous terrain?

You might also like