Introduction to Algorithms Engineering 1D04, Teaching Session 1.

Slides:



Advertisements
Similar presentations
Working With Algorithm and Flowcharts
Advertisements

College of Information Technology & Design
CS101: Introduction to Computer programming
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Flow chart and Algorithm. Announcement Exam One – Wednesday October 1st – 100 points – Mixture of short answer, problem solving, matching, and maybe a.
Reference :Understanding Computers
UNIT SONG “I WAKE UP”. I wake up I wash my face.
Chapter 10 Algorithmic Thinking. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives List the five essential.
Programming Logic and Design Seventh Edition
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
1 Pertemuan 01 Algorithm Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
Chapter 2: Design of Algorithms
Flow Charts. Thinking Creatively Flow Charts START END Is A==6? No A = 1 Yes Print A A = A + 1.
Computer Programming Basics. Computer programs are a detailed set of instructions given to the computer They tell the computer: 1. What actions you want.
The Fundamentals: Algorithms, the Integers & Matrices.
CSCI-100 Introduction to Computing Algorithms Part I.
An Introduction to Programming with C++ Sixth Edition
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Arrays, Type Casting and Constants Engineering 1D04, Teaching Session 5.
I WAKE UP IN THE MORNING 5 POINTS I BRUSH MY TEETH 3 POINTS.
CPS120 Introduction to Computer Programming The Programming Process.
Visual Basic Programming
Algorithms & Flowchart
ITEC113 Algorithms and Programming Techniques
File Input and Output (I/O) Engineering 1D04, Teaching Session 7.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
Computers, Variables and Types Engineering 1D04, Teaching Session 2.
Algorithms Java Methods A & AB Object-Oriented Programming and Data Structures Maria Litvin ● Gary Litvin Copyright © 2006 by Maria Litvin, Gary Litvin,
Faculty of Sciences and Social Sciences HOPE Structured Problem Solving Week 3: Algorithms Stewart Blakeway FML 213
Structured Programming (4 Credits)
ALGORITHMS.
Visual Basic Flowcharts October 10, Turn in your vocabulary words before you leave!
Problem, Problem Solving, Algorithm & Flow Charts –Part 1 Presented By Manesh T Course:101 CS 101CS Manesh T1.
Comments, Conditional Statements Continued, and Loops Engineering 1D04, Teaching Session 4.
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?
WHAT IS THIS? Clue…it’s a drink SIMPLE SEQUENCE CONTROL STRUCTURE Introduction A computer is an extremely powerful, fast machine. In less than a second,
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
Software Engineering: Models David Millard
AS Computer Studies Algorithms & Problem Solving 1 & 2.
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.
ICS 3UI - Introduction to Computer Science
Understand Problem Solving Tools to Design Programming Solutions
Problem , Problem Solving, Algorithm & Flow Charts –Part 1
ALGORITHMS part-1.
Two Dimensional Arrays and Complex Conditions
Data Structures and Algorithms
Understand Problem Solving Tools to Design Programming Solutions
Introduction to Computer Programming
Problem Solving Techniques
An Introduction to Control Structures
Morning Activities ESL Lesson Beginning Level
Algorithms & Pseudocode
Introduction to Algorithms
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
An Introduction to Control Structures
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Basic Concepts of Algorithm
Global Challenge Night Sensor Lesson 2.
Presentation transcript:

Introduction to Algorithms Engineering 1D04, Teaching Session 1

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng1 Introductions

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng2 Course Webpage:

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng3 Introduction to Algorithms  Problems require solutions.  The solution to a problem must be stated clearly.  A clear sequence of steps for solving a specific problem is called an algorithm.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng4 Introduction to Algorithms  Task 1  Get into groups of 4 and create an algorithm to safely cross a road. Try to be as precise as possible. Some groups will get to share their algorithms.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng5 Task 1 Problems  The order in which tasks are performed is often not obvious.  The individual steps themselves are often ambiguous.  Often, the chicken never gets across the road.  It would be nice to have a more formal way of describing the actions involved in performing a task.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng6 Waking up!!  Get Out of Bed  Brush Teeth  Eat Breakfast  Brush Teeth Again  Wash  Get Dressed  Put on Shoes  Run to Catch Bus

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng7 Get Out of Bed Start Brush Teeth WashGet Dressed Eat BreakfastBrush TeethRun to Catch Bus Put on Shoes Finish Start / Stop Box Statement Box Waking in the Morning

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng8 Start / Stop Box Statement Box Flowchart Elements

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng9 Waking up!!  Unfortunately, we are not all that organized. We can’t all have such a structured morning experience.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng10 Waking up!!  Unfortunately, we are not all that organized. We can’t all have such a structured morning experience.  What if we’re short on time? Does this change our decision making process?

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng11 Start / Stop Box Decision Box Statement Box Flowchart Elements

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng12 Decision Box Are you hungry? Yes No Eat breakfast Catch bus Decision Box

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng13 Get Out of Bed Start Brush Teeth WashGet Dressed Eat BreakfastBrush TeethRun to Catch Bus Put on Shoes Finish Is There Extra Time? Yes No Waking in the Morning with Decision

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng14 Waking in the Morning with Decision  Get Out of Bed  Brush Teeth  If There is Extra Time  Eat Breakfast  Brush Teeth (Again)  Wash  Get Dressed  Put on Shoes  Run to Catch Bus

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng15 Crossing the Road  Some tasks need to be repeated until a condition is satisfied.  Walking can be described as move left foot forward, move right foot forward, left foot, right foot ….  This can be visualized by a loop in the flowchart.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng16 Move Left Foot Forward Move Right Foot Forward Are you on the other side? Yes No Finish … Crossing the Road

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng17 Crossing the Road  …  While you’re not on the other side  Move Left Foot Forward  Move Right Foot Forward

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng18 Introduction to Algorithms  Task 2  Return to your groups. Make a flowchart for safely crossing a road and derive a natural language description from it. Be as detailed as possible. Compare it to your previous natural language description.

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng19 Algorithms  What are the most important characteristics of an algorithm?

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng20 Algorithms  What are the most important characteristics of an algorithm?  A step-by-step procedure for solving a problem  Finite number of steps  Depends only on input

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng21 Algorithms  Need only:  sequential actions  decisions  “while” loops (iteration)  Anything that is computable can be computed using just these control structures

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng22 A More Mathematical Example  Let’s try an algorithm that is more mathematical  Do these two lines intersect?  Line 1: (x 1, y 1 )  (x 2, y 2 )  Line 2:(u 1, v 1 )  (u 2, v 2 ) (same groups - work it out)

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng23 Intersecting Lines

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng24 Intersecting Lines What problems will you face?

© Copyright 2006 David Das, Ryan Lortie, Alan Wassyng25 Intersecting Lines  Work on the problem between now and Lab 2 - you will need to solve this in that lab session.