Αρχική » Άρθρα με ετικέτα 'BBC'
Αρχείο ετικέτας BBC
BBC Evaluating solutions test
Visit BBC site to take the test Evaluating solutions test
BBC Evaluation of a solution
How do we evaluate our solution?
- does the solution make sense?
Do you now fully understand how to solve the problem? If you still don’t clearly know how to do something to solve our problem, go back and make sure everything has been properly decomposed. Once you know how to do everything, then our problem is thoroughly decomposed.
- does the solution cover all parts of the problem?
For example, if drawing a cat, does the solution describe everything needed to draw a cat, not just eyes, a tail and fur? If not, go back and keeping adding steps to the solution until it is complete.
- does the solution ask for tasks to be repeated?
If so, is there a way to reduce repetition? Go back and remove unnecessary repetition until the solution is efficient.
Once you’re happy with a solution, ask a friend to look through it. A fresh eye is often good for spotting errors.
Dry runs
One of the best ways to test a solution is to perform what’s known as a ‘dry run’. With pen and paper, work through the algorithm and trace a path through it.
For example, in Algorithms, a simple algorith was created to ask someone their name and age, and to make a comment based on these. You could try out this algorithm – give it a dry run. Try two ages, 15 and 75. When using age 75, where does the algorithm go? Does it give the right output? If you use age 15, does it take you down a different path? Does it still give the correct output?
If the dry run doesn’t give the right answer, there is something wrong that needs fixing. Recording the path through the algorithm will help show where the error occurs.
BBC Problems with solutions
Solutions that are not properly decomposed
- what kind of cake to bake
- what ingredients are needed, how much of each ingredient, and when to add it
- how many people the cake is for
- how long to bake the cake for
- what equipment is needed
A diagram of a further decomposition of ingredients would look like this:
At the moment, a diagram of the further decomposition of equipment would look like this:
The ‘Equipment’ part is not properly broken down (or decomposed). Therefore, if the solution – or algorithm – were created from this, baking the cake would run into problems. The algorithm would say what equipment is needed, but not how to use it, so a person could end up trying to use a knife to measure out the flour and a whisk to cut a lump of butter, for example. This would be wrong and would, of course, not work.
Ideally, then, ‘Equipment’ should be decomposed further, to state which equipment is needed and which ingredients each item is used with.
The problem occurred here because the problem of which equipment to use and which ingredients to use it with hadn’t been fully decomposed.
Solutions that are incomplete
- what kind of cake to bake
- what ingredients are needed, how much of each ingredient, and when to add it
- how many people the cake is for
- how long to bake the cake for
- what equipment is needed
However, this is incomplete – part of the problem has been left out. We still need to know:
- where to bake the cake
- what temperature to bake the cake at
Therefore, if this information was used to create the solution, the algorithm would say how long the cake should be baked for but it would not state that the cake should be placed in the oven, or the temperature that the oven should be. Even if the cake made it to the oven, it could end up undercooked or burnt to a cinder.
Very important factors have been left out, so the chances of making a great cake are slim.
The problem occurred here because placing the cake in the oven and specifying the oven temperature had not been included, making the solution incomplete.
Solutions that are inefficient
It would be more efficient to fetch all the ingredients in one go, and the program would be shorter as a result:
The solution is now simpler and more efficient, and has reduced from nine steps to five.
The problem occurred here because some steps were repeated unnecessarily, making the solution inefficient and overly long.
Solutions that do not meet the original design criteria
- what kind of cake to bake
- what ingredients are needed, how much of each ingredient, and when to add it
- how many people the cake is for
- how long to bake the cake for
- what equipment is needed
The first point considers what kind of cake to bake. Often, when devising solutions to problems, a specification for the design is given. For example, the cake may have to be a chocolate cake, which is still quite general, or a chocolate fudge cake with chocolate icing and flakes on top, which is more specific.
To meet the design criteria, it is important to ensure that the exactly right kind of cake is baked. Otherwise the solution may not be fit for purpose.
The problem occurred here because the solution did not meet the original design criteria – it was not exactly what was requested.
BBC What is computational thinking?
Computers can be used to help us solve problems. However, before a problem can be tackled, the problem itself and the ways in which it could be solved need to be understood.
Computational thinking allows us to do this.
Computational thinking allows us to take a complex problem, understand what the problem is and develop possible solutions. We can then present these solutions in a way that a computer, a human, or both, can understand.
The four cornerstones of computational thinking
There are four key techniques (cornerstones) to computational thinking:
- decomposition – breaking down a complex problem or system into smaller, more manageable parts
- pattern recognition – looking for similarities among and within problems
- abstraction – focusing on the important information only, ignoring irrelevant detail
- algorithms – developing a step-by-step solution to the problem, or the rules to follow to solve the problem
Each cornerstone is as important as the others. They are like legs on a table – if one leg is missing, the table will probably collapse. Correctly applying all four techniques will help when programming a computer.
Source BBC
BBC Test on Computational Thinking
How much do you know about Computational Thinking? Follow the link to take the test at BBC site
BBC Computational thinking in practice
A complex problem is one that, at first glance, we don’t know how to solve easily.
Computational thinking involves taking that complex problem and breaking it down into a series of small, more manageable problems (decomposition). Each of these smaller problems can then be looked at individually, considering how similar problems have been solved previously (pattern recognition) and focusing only on the important details, while ignoring irrelevant information (abstraction). Next, simple steps or rules to solve each of the smaller problems can be designed (algorithms).
Finally, these simple steps or rules are used to program a computer to help solve the complex problem in the best way.
Source BBC
BBC Evaluating
Evaluating solutions
Before solutions can be programmed, it is important to make sure that it properly satisfies the problem, and that it does so efficiently. This is done through evaluation.
What is evaluation?
- is easily understood – is it fully decomposed?
- is complete – does it solve every aspect of the problem?
- is efficient – does it solve the problem, making best use of the available resources (eg as quickly as possible/using least space)?
- meets any design criteria we have been given
If an algorithm meets these four criteria it is likely to work well. The algorithm can then be programmed.
Failure to evaluate can make it difficult to write a program. Evaluation helps to make sure that as few difficulties as possible are faced when programming the solution.
Why do we need to evaluate our solutions?
What happens if we don’t evaluate our solutions?
Once a solution has been decided and the algorithm designed, it can be tempting to miss out the evaluating stage and to start programming immediately. However, without evaluation any faults in the algorithm will not be picked up, and the program may not correctly solve the problem, or may not solve it in the best way.
Faults may be minor and not very important. For example, if a solution to the question ‘how to draw a cat?’ was created and this had faults, all that would be wrong is that the cat drawn might not look like a cat. However, faults can have huge – and terrible – effects, eg if the solution for an aeroplane autopilot had faults.
Ways that solutions can be faulty
We may find that solutions fail because:
- it is not fully understood – we may not have properly decomposed the problem
- it is incomplete – some parts of the problem may have been left out accidentally
- it is inefficient – it may be too complicated or too long
- it does not meet the original design criteria – so it is not fit for purpose
A faulty solution may include one or more of these errors.
BBC Representing an algorithm: Pseudocode and flowcharts
There are two main ways that algorithms can be represented – pseudocode and flowcharts.
Representing an algorithm: Pseudocode
Most programs are developed using programming languages. These languages have specific syntax that must be used so that the program will run properly. Pseudocode is not a programming language, it is a simple way of describing a set of instructions that does not have to use specific syntax.
Writing in pseudocode is similar to writing in a programming language. Each step of the algorithm is written on a line of its own in sequence. Usually, instructions are written in uppercase, variables in lowercase and messages in sentence case.
In pseudocode, INPUT asks a question. OUTPUT prints a message on screen.
A simple program could be created to ask someone their name and age, and to make a comment based on these. This program represented in pseudocode would look like this:
OUTPUT 'What is your name?'
INPUT user inputs their name
STORE the user's input in the name variable
OUTPUT 'Hello' + name
OUTPUT 'How old are you?'
INPUT user inputs their age
STORE the user's input in the age variable
IF age >= 70 THEN
OUTPUT 'You are aged to perfection!'
ELSE
OUTPUT 'You are a spring chicken!'
Representing an algorithm: Flowcharts
Flowchart symbols
A simple program could be created to ask someone their name and age, and to make a comment based on these. This program represented as a flowchart would look like this:
BBC Algorithms
An algorithm is a plan, a set of step-by-step instructions to resolve a problem. In an algorithm, each instruction is identified and the order in which they should be carried out is planned.
What is an algorithm?
Making a plan
It is important to plan out the solution to a problem to make sure that it will be correct. Using computational thinking and decomposition we can break down the problem into smaller parts and then we can plan out how they fit back together in a suitable order to solve the problem.
This order can be represented as an algorithm. An algorithm must be clear. It must have a starting point, a finishing point and a set of clear instructions in between.