CSCI-100 Introduction to Computing Algorithms Part I.

Slides:



Advertisements
Similar presentations
Structures at a Glance Timed Pair Share Stand Up, Hand Up, Pair Up
Advertisements

College of Information Technology & Design
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Computers and Scientific Thinking David Reed, Creighton University Algorithms and Programming Languages 1.
ISP 121 Algorithmsand Computer Programming. Why Know Simple Programming?  You can create powerful macros in Access / Excel / Word / ??? to manipulate.
Basic Programming Concepts INTRO TO PROGRAMMING. Questions to answer  What is a computer program?  What are computer instructions  How is a program.
Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the five essential properties of an algorithm.
Chapter 10 Algorithmic Thinking. Copyright © 2013 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Learning Objectives List the five essential.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, Java Version, Third Edition.
What is an algorithm? Informally: An Algorithm is a step by step method for solving a problem. It’s purpose is to break a larger task down so that each.
Discrete Mathematics Algorithms. Introduction Discrete maths has developed relatively recently. Its importance and application have arisen along with.
Chapter 1: An Introduction to Computer Science
School of Computing Science CMT1000 © Ed Currie Middlesex University 1 CMT1000: Introduction to Programming Ed Currie Lecture 1B: Problem Solving.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, C++ Version, Fourth Edition --slides rearranged by Shannon Steinfadt for.
Programming Fundamentals (750113) Ch1. Problem Solving
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
ALGORITHMS AND FLOW CHARTS 1 Adapted from the slides Prepared by Department of Preparatory year Prepared by: lec. Ghader Kurdi.
The Fundamentals: Algorithms, the Integers & Matrices.
Chapter 1: An Introduction to Computer Science Invitation to Computer Science, Java Version, Third Edition.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Lecture # 8 ALGORITHMS AND FLOWCHARTS. Algorithms The central concept underlying all computation is that of the algorithm ◦ An algorithm is a step-by-step.
An ordered sequence of unambiguous and well-defined instructions that performs some task and halts in finite time Let's examine the four parts of this.
Introduction to Programming. What is a Program  Set of Instructions that tells the computer what to Do.  Driving force behind the computer  Without.
Multiplication and Division Math Content – Part 3 March 4, 2013.
Computer Programming TCP1224 Chapter 2 Beginning the Problem-Solving Process.
Algorithms and Programming
Introduction to Programming ICS2O Findlay. Learning Goals  We will learn  The definitions of a computer, program and programming language.  The different.
An Introduction to Programming with C++ Sixth Edition
Introduction Algorithms and Conventions The design and analysis of algorithms is the core subject matter of Computer Science. Given a problem, we want.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
1 Invitation to Computer Science 6 th Edition Chapter 1 An Introduction to Computer Science.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Algorithms CS139 – Aug 30, Problem Solving Your roommate, who is taking CS139, is in a panic. He is worried that he might lose his financial aid.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
Algorithms & Flowchart
COMPUTERS AND ALGORITHMIC PROCESSES LSP 121. What Is An Algorithmic Process? An ordered series of steps that when applied to a problem produces a solution.
CS221 Algorithm Basics. What is an algorithm? An algorithm is a list of instructions that transform input information into a desired output. Each instruction.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation Dale Roberts, Lecturer Computer Science,
CSCI-100 Introduction to Computing
The Beauty and Joy of Computing Lecture #6 Algorithms I UC Berkeley EECS Sr Lecturer SOE Dan Garcia.
Structured Programming (4 Credits)
ALGORITHMS.
© Janice Regan, CMPT 128, February CMPT 128: Introduction to Computing Science for Engineering Students Recursion.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
Chapter 10 Algorithmic Thinking. Learning Objectives Explain similarities and differences among algorithms, programs, and heuristic solutions List the.
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.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Program Design & Development EE 201 C7-1 Spring
The Beauty and Joy of Computing Lecture #6 Algorithms I Jon Kotker UC Berkeley EECS 2010, 2013 Microsoft
Discrete Mathematics Algorithms.
COMS W1004 Introduction to Computer Science and Programming in Java
Creativity in Algorithms
An Introduction to Control Structures
Programming Fundamentals (750113) Ch1. Problem Solving
Programming Fundamentals (750113) Ch1. Problem Solving
Problem Solving and Algorithm Design
Programming Fundamentals
Algorithms and Programming Languages
Programming Fundamentals (750113) Ch1. Problem Solving
An Introduction to Control Structures
ICT Gaming Lesson 2.
An Introduction to Programming with C++ Fifth Edition
Programming Fundamentals (750113) Ch1. Problem Solving
Computers and Scientific Thinking David Reed, Creighton University
Basic Concepts of Algorithm
Learning Intention I will learn about the standard algorithm for input validation.
Presentation transcript:

CSCI-100 Introduction to Computing Algorithms Part I

Algorithms The central concept underlying all computation is that of the algorithm An algorithm is a step-by-step sequence of instructions for carrying out some task Programming can be viewed as the process of designing and implementing algorithms that a computer can carry out A programmer’s job is to: Create an algorithm for accomplishing a given objective, then Translate the individual steps of the algorithm into a programming language that the computer can understand

Dictionary definition Procedure for solving a mathematical problem in a finite number of steps that frequently involves repetition of an operation A step-by-step method for accomplishing a task Informal description An ordered sequence of instructions that is guaranteed to solve a specific problem –STEP 1: Do something. –STEP 2: Do something. –STEP 3: Do something... –STEP N: Stop. You are finished.

Categories of operations Sequential operations Carry out a single well-defined task; when that task is finished, the algorithm moves on to the next operation –Add 1 cup of butter to the mixture in the bowl –Subtract the amount of the check from the current account balance Conditional operations Ask a question and then select the next operation to be executed on the basis of the answer to that question –If the mixture is too dry, then add one-half cup of water to the bowl Iterative operations Tell us to go back and repeat the execution of a previous block of instructions –Repeat previous operations until mixture has thickened

Example Algorithm for programming your VCR (DONE IN CLASS)

Steps to solving problems Understand the problem Devise a plan Carry out your plan Examine the solution EXAMPLE: finding the oldest person in a room full of people. We will consider 2 different algorithms for solving this problem

Algorithm 1 Line up all the people along one wall Ask the first person to state his or her name and birthday, then write this information down on a piece of paper For each successive person in line: Ask the person for his or her name and birthday if the stated birthday is earlier than the birthday on the paper, cross out old information and write down the name and birthday of this person

Algorithm 2 Line up all the people along one wall As long as more than one person in the line, repeatedly Have the people pair up (1 st with 2 nd, 3 rd with 4 th, etc) – if there is an odd number of people, the last person will be without a partner Ask each pair of people to compare their birthdays Request that the younger of the two leave the line

Algorithm Analysis Algorithm 1 involves asking each person’s birthday and then comparing it to the birthday written on the page The amount of time to find the oldest person is proportional to the number of people If you double the amount of people, the time needed to find the oldest person will also double Algorithm 2 allows you to perform multiple comparisons simultaneously The time needed to find the oldest person is proportional to the number of rounds it takes to shrink the line down to one person –Which turns out to be the logarithm (base 2) of the number of people If you double amount of people, the time needed to find the oldest person increases by the cost of one more comparison