Everyday Algorithms....a lightning introduction to algorithms

Similar documents
Busy Ant Maths and the Scottish Curriculum for Excellence Foundation Level - Primary 1

Objective: Estimate and measure liquid volume in liters and milliliters using the vertical number line.

Orientation and Conferencing Plan Stage 1

Objective: Estimate and measure liquid volume in liters and milliliters using the vertical number line.

ROBOT C CHALLENGE DESIGN DOCUMENT TEAM NAME. Sample Design Document. Bolt EVA. Lightning. RoboGirls. Cloud9. Femmebots

Fourth Grade. Multiplication Review. Slide 1 / 146 Slide 2 / 146. Slide 3 / 146. Slide 4 / 146. Slide 5 / 146. Slide 6 / 146

Fourth Grade. Slide 1 / 146. Slide 2 / 146. Slide 3 / 146. Multiplication and Division Relationship. Table of Contents. Multiplication Review

ACTIVITY 1: Electric Circuit Interactions

Working with Shopping Carts

Setup Guide and Chassis Tuning Tips (simple version) By Jim Daniels

Correlation to the New York Common Core Learning Standards for Mathematics, Grade K

1. (s r r d v i e) These people work on buses or in taxis. They are. 2. (s s s g p n r a e e) These people ride on public transportation.

Standard Lockers Series Double Tier Installation Instructions

Rules for Motorcyclists reading tasks to drive/highway code/highwaycode?sec=5rule 83

VIDA SUBSCRIPTION INSTRUCTION CONTENTS

Point out that throughout the evaluation process the evaluator must be cognizant of officer safety issues.

Section 1: Pneumatic Systems

Q1. To get a bobsleigh moving quickly, the crew push it hard for a few metres and then jump in.

Wheel Changing ! WARNING: Spare Wheel Location

Grade 8 Science. Unit 4: Systems in Action

How to Store a Billion Beans [Language Arts]

Series and Parallel Circuits Virtual Lab

Market survey on fleet managers purchase behaviour

CHASSIS DYNAMICS TABLE OF CONTENTS A. DRIVER / CREW CHIEF COMMUNICATION I. CREW CHIEF COMMUNICATION RESPONSIBILITIES

Stopping distance = thinking distance + braking distance.

I n s t r u c t i o n M a n u a l. Swiss Jib Crane

Correlation to the New York Common Core Learning Standards for Mathematics, Grade 1

Free-Standing Mathematics Qualification Advanced Level June Use black ink or black ball-point pen. Pencil should only be used for drawing.

USER MANUAL VB-SEMIAIR. Increased comfort Better driveability More safety. making everyday smoother COMMERCIAL VEHICLE - MOTORHOME

Make sure you have extra help or heavy duty lifting equipment when unloading and assembling the Atlas Auto SPINS Rotisserie.

Take a fresh look at solar things you should consider when purchasing a solar system

ANNEX F TESTING STANDARDS FOR PORTABLE SOLAR LAMPS

Lincoln Mark VII Hood Insulation Repair Version written by AZMarkVII

MEYLAND-SMITH A/S EST User manual for MEYWALK 2000 model Medium and Large

Chapter 2 & 3: Interdependence and the Gains from Trade

1. (3) My faucet runs at a rate of 5 gallons a minute. How many gallons a second is that?

Green Drive Nov 2020

LET S ARGUE: STUDENT WORK PAMELA RAWSON. Baxter Academy for Technology & Science Portland, rawsonmath.

DRIVING Question: Is it important to know how to drive? Are you a good driver? Complete the paragraph on the right with the words on the left.

Correlation S T A N D A R D S F O R M A T H E M A T I C A L C O N T E N T. Know number names and the count sequence.

Improving the gearshift feel in an SW20.

Replacing the hub oil seal.

A car-free world? Name:... Date:... Car-free Day comprehension. The Development of Cars

This is an easy to read report.

SECTION 3. PARTS INFORMATION INTRODUCTION This section identifies and lists the replaceable parts of the Henny Penny merchandiser.

(12) Patent Application Publication (10) Pub. No.: US 2005/ A1. WOOdrow (43) Pub. Date: Jan. 20, 2005

GLOVE BOX CHECK IT GUIDE

Gas and Groceries Rewards FAQs

SI AT A22. English. Printed: Doc-Nr: PUB / / 000 / 01

SRM 7.0 Detailed Requisitioning

SI AT A22. English. Printed: Doc-Nr: PUB / / 000 / 03

1986 Rear Disk Brake Upgrade. All hard lines mounted to the rear axle with mounting screws. 1/4" fittings

INTERNATIONAL STANDARD

Parking Manual for new drivers

SUPERMARKET ICE CREAM CHEST COOLERS & FREEZERS

BY Outdoor LP Gas Barbecue Grill

ECOKIDS BATTERY BUSTERS AUDIT

Mustang Radiator Conversion DIY. By GearHeadPeter. January 27, 2011

Engineering Science: Pneumatics ENGINEERING SCIENCE. Pneumatic Systems

Tyre Pressure Monitoring System

KONGSKILDE KONNECT 1000

Physics 2048 Test 2 Dr. Jeff Saul Fall 2001

Explorer Version 3 Instructions

Buying Your First Crane? Here s What You Need to Know

SW20 Coolant System Maintenance.

FOUR-ON-THE SNOW Newsletter

Troubleshooting Guide for Limoss Systems

INTERNATIONAL STANDARD

BMW E61 Hydraulic Pump replacement instructions

Amazing127_RobotCDesignDoc

UP TO 360kg SHELF CAPACITY QUICK & EASY BOLT-FREE ASSEMBLY STRONG, ROBUST & MODERN DESIGN ASSEMBLY DESIGN. Post. No post required.

Scavenger hunt Equipment

INTERNATIONAL STANDARD

Troubleshooting Guide for Okin Systems

Correlation to the. Common Core State Standards. Go Math! 2011 Grade K

User manual for. meywalk 2000 model Medium and Large

Chapter 4 Utility Systems Electrical

C6 Corvette M/T Differential Strut Installation Instructions

Camera Electronics Systems

Scholastic s Early Childhood Program Correlated to the Minnesota Pre-K Standards

This robust series comprises several versions allowing gaseous and liquid SF 6

Autonomous Mobile Robots (AMR s) Olaf Zalmstra

ADDICTIVE DESERT DESIGNS

Hood stripes Tools needed from AutoZone or any auto parts store: bottle spray, squeegee, a towel that you re using to clean you car up after washing,

GUARANTEED BUY BACK WITH FUSO AGILITY.

RL Circuits Challenge Problems

This guide will explain how to remove the old springs from the car and replace them with lowering springs.

Torsion Axle Air Ride Installation Instructions Tandem or Triple KLM

REQUEST AND SUBMISSION FORMS

TE-HUD User Manual. l ::: J TECH SUPPORT. MetraDealer.com

Remote control your Mercedes. climate KeylessGo Installation Manual

C5 Corvette M/T Differential Strut Installation Instructions

Luggage System Fitting Instructions - Sprint ST

Weight Conversions. 1 Ounce Pound

MODEL DL35-CV LED REAR DECK LIGHT

AUTO 140A: VEHICLE MAINTENANCE

Introducing. chip and PIN

STORAGE SPECIFICATIONS Low Storage, Two Drawer - 30 width

AgriWheel Single Gate Kit Low Voltage & Solar. Installation & Operating Instructions

NEED HELP? CONTACT US!

Transcription:

Everyday Algorithms...a lightning introduction to algorithms

Building a table

Building a flat-pack table

Building a flat-pack table Write the solution out in natural language. Refine the wording, make it as clear and concise as possible. grammar not so important; pseudocode Number the steps (1, 2, 3 ) to indicate the order in which they must be done. Draw boxes around each of the sub-parts, especially those that are done repeatedly. Use indentation to clearly show sub-steps.

Building a flat-pack table Lay the table top upside-down on the ground Secure each of the four flanges to a corner of the table top using 3 screws each. Next, screw a table leg into each flange. Turn the completed table the right way up! 1. For each corner of the table top secure the flange to the corner using 3 screws 2. For each flange screw a table leg into the flange

Building a flat-pack table IMPORTANT: multiple equally correct solutions! naturally have sequence of steps and repetition of steps. Another solution: screw the legs into each of the flanges screw each flange to a corner of the table top

Building a flat-pack table Lay the table top upside-down on the ground Attach a table leg to each corner of the table top. Turn the completed table the right way up! For each corner of the table top attach a table leg to corner. position a flange on the corner and secure it with 3 screws, then screw the leg into the flange. For each corner of the table top 1. position a flange on the corner 2. secure flange in place with 3 screws 3. screw a leg into the flange

Building a flat-pack table Could you tell the difference? For each corner of the table top 1. position a flange on the corner 2. secure flange in place with 3 screws 3. screw a leg into the flange 1. For each corner of the table top secure the flange to the corner using 3 screws 2. For each flange screw a table leg into the flange

Changing a flat tyre

Your turn Explain how to change a flat tyre. Provide an algorithm (set of instructions or a procedure) that solves the problem.

Changing a flat-tyre Sample solution_1 1.Ensure the car is parked safely and cannot roll. 2.Remove wheel with flat tyre 3.Replace it with the spare wheel 4.Drive off Which one? Sample solution_2 1.Ensure the car is parked safely and cannot roll. 2.Take the jack, spanner and spare wheel from the trunk. 3.Slacken the wheel nuts on the wheel with the flat tyre 4.Jack the car up so the wheel with the flat tyre can be removed. 5.Remove all the nuts from wheel with the flat tyre 6.Take the wheel off and place it in the trunk 7.Put the spare wheel on in place of the one with the flat tyre 8.Put the nuts on and tighten as much as possible 9.Lower the car off the jack 10.Fully tighten the nuts on the new wheel 11.Put the jack and spanner back in the trunk 12.Drive off

Changing a flat-tyre The best of both solutions? Sample solution_3 1.Ensure the car is parked safely and cannot roll. 2.Remove wheel with flat tyre 1.Take the jack, spanner and spare wheel from the trunk. 2.Slacken the wheel nuts on the wheel with the flat tyre 3.Jack the car up so the wheel with the flat tyre can be removed. 4.Remove all the nuts from wheel with the flat tyre 5.Take the wheel off and place it in the trunk 3.Replace it with the spare wheel 1.Put the spare wheel on in place of the one with the flat tyre 2.Put the nuts on and tighten as much as possible 3.Lower the car off the jack 4.Fully tighten the nuts on the new wheel 5.Put the jack and spanner back in the trunk 4.Drive off

Changing a flat-tyre Sample solution_4 1.Ensure the car is parked safely and cannot roll. 2.Remove wheel with flat tyre 3.Replace it with the spare wheel 4.Drive off The best? 2.Remove wheel with flat tyre 1.Take the jack, spanner and spare wheel from the trunk. 2.Slacken the wheel nuts on the wheel with the flat tyre 3.Jack the car up so the wheel with the flat tyre can be removed. 4.Remove all the nuts from wheel with the flat tyre 5.Take the wheel off and place it in the trunk 3.Replace it with the spare wheel 1.Put the spare wheel on in place of the one with the flat tyre 2.Put the nuts on and tighten as much as possible 3.Lower the car off the jack 4.Fully tighten the nuts on the new wheel 5.Put the jack and spanner back in the trunk

Changing a flat-tyre do high-level minimal solution first check & if ok then add detail to each piece as necessary only need to think about piece, not whole

Supermarket shopping

Supermarket Shopping List Given a shopping list, go to the supermarket, buy all the items on it and take them home. shelves checkout entrance exit

Supermarket Shopping List Given a shopping list, go to the supermarket, buy all the items on it and take them home. 1. With your shopping list, go to the market 2. From the market, buy the items on your shopping list. 3. Return home with the items you purchased. shelves checkout entrance exit

Supermarket Shopping Collect a shopping cart on the way into the market. Walk around the market looking at the items on each shelf. If the item on the shelf is on your shopping list, take it from the shelf and add it to the items in your shopping cart. After visiting all the shelves, go to the checkout and pay for the items in your trolley. Leave the empty trolley and exit the market with the items you purchased. 1. Get a shopping cart 2. For each shelf in the market if the item on the shelf is on the list then take the item from the shelf add the item to the shopping cart 3. Go to checkout and pay for items in trolley 4. Leave market with items purchased. entrance exit

Supermarket Shopping (alternative solution) Collect a shopping cart on the way into the market. For each item on your shopping list, go to the shelf containing the item, take it from the shelf and add it to the items in your shopping cart. After completing your shopping list, go to the checkout and pay for the items in your trolley. Leave the empty trolley and exit the market with the items you purchased. 1. Get a shopping cart 2. For each item on the shopping list if the item is in the market then go to the shelf with the item on take the item from the shelf add the item to the shopping cart 3. Go to checkout and pay for items in cart 4. Leave market with items purchased. entrance exit

Supermarket Shopping Get a shopping cart For each shelf in the market if the item on the shelf is on the list then take the item from the shelf add the item to the shopping cart Go to checkout and pay for items in trolley Get a shopping cart For each item on the shopping list if the item is in the market then go to the shelf with the item on take the item from the shelf add the item to the shopping cart Go to checkout and pay for items in cart Possible Problems? Which is best?

Supermarket Shopping Possible problems how might the shopping cart contain extra items? how might the shopping cart be missing items? if the item is on two or more shelves? if the item on the list is not in the market? inconsistencies in naming frozen items last delicate/crushable items on top of heavier ones.

Key Ideas

Terminology Algorithm Sequence of steps to solve a problem Natural language English, Turkish, French, German, Computer code/program Instructions a computer can understand Pseudocode False code, semi-structured English Trace program or algorithm you follow the steps (instead of machine!)

Algorithms An algorithm is a procedure/method comprising the steps to solve a given problem. It must be understandable, effective, correct, & must stop Algorithms comprise: Sequence, decision, repetition Do and next do then do... First do Finally do if then do... if then do else/otherwise do for all/each/every do... while do repeat until

Tips Be consistent in naming things Rewrite Natural language into pseudocode forms (take care with numbering, indentation) High-level solution first, then, after checking correctness and completeness, solve each piece separately Consider alternative solutions (may prefer some for other reasons)