AS Computer Studies Algorithms & Problem Solving 1 & 2.

Slides:



Advertisements
Similar presentations
Breakfast Bytes: Pigeons, Holes, Bridges and Computers Alan Kaylor Cline November 24, 2009.
Advertisements

The 7 Bridges of Konigsberg A puzzle in need of solving.
COP1332 Introduction to Programming Using Visual Basic.NET A journey into thinking Professor Walton.
Everyday Algorithms David Davenport Computer Eng. Dept., Bilkent University Ankara - Turkey. lightning introduction to.
SPEED READING The Little Red Hen 60 words per minute.
Chapter 7 Logic, Sets, and Counting
6.3 Basic Counting Principles In this section, we will see how set operations play an important role in counting techniques.
Chapter 7 Logic, Sets, and Counting Section 3 Basic Counting Principles.
The case of the Missing Sock
Binary Math CS208. Decimal Addition Example ) Add = 15 Write down 5, carry ) Add = 8 Write down 8 3)
By Dr. C. B. Alphonce (Room305 Mathematics Building) MT 147: DISCRETE MATHEMATICS (3 Units) CORE for B. SC. In COMPUTER SCIENCE.
Robot? What’s a Robot? Introducing Karel-the-Robot.
Mrs .Nathalie Paizy Morales
What kind of rock grows?. This delicious candy is actually crystalized sugar and you can grow it from your own sugar-water solution. As a kid I thought.
Problem Solving. What is a Problem? An ambiguous situation not clearly showing how to reach the goal. Given Initial Situation Desired Goal Situation What.
2 Equations with 2 Unknowns Created by Daniel Seiltz Click Me to Begin!
Introduction to Programming Doman’s Lecture CSCI101.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
The Scientific Method Challenge Directions… 1.Take out a sheet of paper and pencil. 2.When you see the problem, do not say or yell out ANY IDEAS you.
How we do things in our classroom…
Introduction to Programming Initial Slides developed by Dr. Doman.
1 Starter of the day 23 x 27 = x 47 = x 87 = x 55 = x 58 = ???? 54 x 56 = ???? Can you spot the trick for this group of.
Program Development Life Cycle (PDLC)
Chapter 3 Developing an algorithm. Objectives To introduce methods of analysing a problem and developing a solution To develop simple algorithms using.
Unit 1: Basics // Metrics & Matter Aim: How can we apply the Scientific Method? Do Now: Solve the farmer’s dilemma. (5 minutes) Monday, September 8, 2014.
Introduction to Algorithms Engineering 1D04, Teaching Session 1.
 starter activity Your teacher will give you a slip of paper with a question. Go up to a student and ask the question. Tell her the answer if she doesn’t.
Intermediate 2 Software Development Process. Software You should already know that any computer system is made up of hardware and software. The term hardware.
Draft as of 4/1/05 Management …. Are You Ready to Conduct the Inventory Training for Your Team?
More Lateral Thinking Exercise your brain J.Byrne
The Software Development Process
Teaching Through Problem Solving
Sight Words.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
Problem Solving Logical reasoning or deductive reasoning.
Teacher Notes Vocabulary Magic Steps 1-5
Fall 2001(c)opyright Brent M. Dingle 2001 Simple Sorting Brent M. Dingle Texas A&M University Chapter 10 – Section 1 (and some from Mastering Turbo Pascal.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
STAGE 10: DICE RACE What do you remember from the last class? What was your favorite part? What do you wish we had had time to do?
Problem solving Introduction to programming. Do Now You are at a river that you want to cross with all your goods. Your goods consist of a chicken, a.
n Taking Notes and Keeping a Journal n Listening Skills n Working Together n Managing Your Time.
Sorting Algorithms. Algorithms, revisited What is an algorithm? Wikipedia Definition: an algorithm is a definite list of well-defined instructions for.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Comp1004: Programming in Java II Computational Thinking.
IB Diploma Examinations May 2015 Final advice and explanation of conditions.
By the end of this session you should be able to... Understand what is meant by ‘thinking logically’ including: Identify the points in a solution where.
STARTER WHAT ARE THE SIX SIMPLE MACHINES? WHY DO WE USE SIMPLE MACHINES? WHAT IS THE EFFORT FORCE AND RESISTANCE FORCE? WHAT IS MECHANICAL ADVANTAGE?
Level 3 CYPW Unit Promote Learning and Development in the Early Years Tutor; Karen Sendall.
The Origins of Psychology
List 1 List 1 able about above across after again able about
Copyright © 2008 by Helene G. Kershner
Copyright © 2008 by Helene G. Kershner
List 1 List 1 able about above across after again able about
The Need for Programming Languages
The Need for Algorithms 2 days
Introduction Defining the Problem as a State Space Search.
CS 240 – Lecture 11 Pseudocode.
“In the midst of chaos, there is also opportunity” - Sun Tzu
An Introduction to VEX IQ Programming with Modkit
Chapter 7 Logic, Sets, and Counting
GET READY SETTLER ACTIVITY
4. Computational Problem Solving
1) 2) 3) 4) 5) Warm Up/Do Now Evaluate: OBJECTIVE: Try these problems
Critical Thinking You’ll have 3 minutes today. You’ll need to explain this one, so put your name on it and turn it in so that I can read your explanation.
More Lateral Thinking Exercise your brain J.Byrne 2017.
Basic Concepts of Algorithm
Designing Software Algorithm definition
Year 9 and 10 Transition Days
“In the midst of chaos, there is also opportunity” - Sun Tzu
Chapter 1: Creating a Program.
Presentation transcript:

AS Computer Studies Algorithms & Problem Solving 1 & 2

Starter  You need to get from home to college.  Write down the basic steps involved.  Review in 2 minutes: 1.Wake up 2.Get up 3.Get ready 4.Eat breakfast 5.Catch bus 6.Arrive at college.

Objectives Know what is meant by the term algorithm. Be able to write a simple algorithm for logical problems. Understand the stages of problem solving. Look at how to fully understand the problem: defining a problem.

An Algorithm Sounds like a technical term. “A formal set of instructions that can be followed to perform a specific task, such as a mathematical formula or a set of instructions in a computer program.” A major part of computer science. The process of turning a problem into a set of broken down tasks & instructions which can then be turned into computer code to AUTOMATE the solution to the problem. A good algorithm breaks down a problem efficiently, can be read/followed and can be converted into a computer language. Takes plain English problems and puts them into clearly structured English.

Looking back at the starter: You need to get from home to college. DEFINING THE PROBLEM: A simple ineffective algorithm: 1.Wake up 2.Get up 3.Get ready 4.Eat breakfast 5.Catch bus 6.Arrive at college. Does this suitably describe the problem? Could you follow these instructions and be able to get to college? What does ‘get ready’ actually involve? Does the bus appear in your home? Home College

Algorithm Example This is our top layer of our Algorithm. It does not clearly show everything which is involved. It does break the problem down into small tasks. 1.Wake up 2.Get up 3.Get ready 4.Eat breakfast 5.Catch bus 6.Arrive at college. Let’s look at the problem broken down.problem broken down.

Algorithm Exercise: Time Required 10mins “Thomas requires a cup of milky tea with two sugars brought to him on a try in his living room, placing on the table. Everything needed is in the kitchen. Sugar and teabags are in jars on the worktop. Write a simple algorithm and then break it down into a detailed algorithm. HOMEWORK: Complete the “Additional Algorithms Sheet”Additional Algorithms Sheet

Stages of Problem Solving Understand the problem Define the problem Define boundaries Plan Solution Check the Solution

Understand a Problem You are given the problem. You visualise and understand what the actual problem is. You appreciate why it is a problem.

Defining the Problem This lets you fully understand exactly what the problem involves. Has many CLEARLY DEFINED parts: An initial situation A goal A set of resources A set of constraints (limitations) Stated ownership Let’s work through an example…

A Problem Defined You needs to cross a river in a canoe. With you, you have a bag of grain, a chicken, and a fox. You can only carry one of the three at a time. If you leave the grain and the chicken, the chicken will eat the grain. If you take the grain, the fox will eat the chicken. How does he successfully cross the river with his load? Initial Situation: There’s you, a chicken, a fox, grain all on a river bank, with access to a canoe. Resources: A canoe and your knowledge / understanding of what is needed. Constraints: You can only carry one passenger. Can’t leave grain with chicken. Can’t leave fox with chicken. Goal: You, the chicken, fox and grain are on the other side of the river. Ownership: You will be involved in the planning an solution. How would you solve this problem? SOLUTION: Take the chicken across, leaving it on the other side. Returns alone in the canoe and picks up the bag of grain. After bringing across the grain, takes the chicken back to the original side, dropping him off, and picking up the fox. After bringing the fox to the other side, and leaving it with the grain, return back to the original side, retrieving the chicken, and making your 3rd and final trip crossing the river. At no point was the fox left alone with the chicken, or the chicken with the grain.

Your Turn: 10mins You are in the dark, and on the floor there are six shoes of three colors, and a heap of twenty-four socks, black and brown. How many socks and shoes must you take into the light to be certain that you have a matching pair of socks and a matching pair of shoes? Initial Situation: Resources: Constraints: Goal: Ownership: SOLUTION (HIDE): Three socks and four shoes would guarantee that you would have a matching pair of each. Since there are only two colors of socks, it doesn't matter how many are in the heap, as long as you take at least three, you are certain to have two of the same. As for the shoes, you must pick four, because selecting only three could result in one shoe in each of the three colors!

Why bother defining a problem? The problem would not be fully understood. The solution would not fully meet the requirements. How would you divide the problem up? – When working in a team – different people will do different tasks to contribute to the solution. It is important to think LATERALLY to fully understand and define a problem (challenge assumptions and establish facts)

Defining Boundaries Establishing what can or cannot be done to solve a problem. A way of identifying limitations. These could be anything. – Time – Available equipment – Software Lateral thinking is needed to ensure only real constraints are identified. – Ask questions – Identify what assumptions you are making and separate them from facts. – Form new facts from the questions asked, adding them to originally given information from the problem.

Problem Definition: Task 1 “Romeo and Juliet are lying dead on the floor, surrounded by water and broken glass. What happened?” Define the problem. – An initial situation – A goal – A set of resources – A set of constraints (limitations) – Stated ownership Define the boundaries. – Ask questions – Obtain facts, not assumptions.

Problem Definition: Task 2 “A man lives on the 18 th floor of a tower block. Every weekday morning he takes the lift to the ground floor and walks to work. When he comes back, he takes the lift to the 12 th floor and walks up the remaining 6 floor to get back to his flat. Why does he not use the lift the 18 th floor every weekday evening?” Define the problem. – An initial situation – A goal – A set of resources – A set of constraints (limitations) – Stated ownership Define the boundaries. – Ask questions – Obtain facts, not assumptions.

Algorithm Exercises Complete the additional algorithms exercises. Consider the stages in problem solving. Understand the problem Define the problem Define boundaries Plan Solution Check the Solution

Objectives Review Know what is meant by the term algorithm. Be able to write a simple algorithm for logical problems. Understand the stages of problem solving. Look at how to fully understand the problem: defining a problem.

Plenary What is an algorithm? What are the stages in problem solving? Why is it important to clearly define a problem? Why is it important to think laterally?