ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing

Size: px
Start display at page:

Download "ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing"

Transcription

1 ENGG1811 Computing for Engineers Week 10 Recursion, External Application Interfacing ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 1

2 This Week Wednesday am: Will include discussion about assignment 2 Wednesday pm: Will include VBA exam revision examples References Recursion is covered quite nicely at not quite so well in Chapra Section 12.4 Recursion ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 2

3 Recursive Factorial Recursion is implemented through functions or subprograms calling themselves rather than another procedure Works provided the base case is handled and there are sufficient resources to sustain the calculation Function fact(n As Integer) As Long If n = 0 Then Else End If fact = 1 End Function fact = n * fact(n-1) ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 3

4 Tracing Factorial Trace the calculation as with other procedure calls fact(5) = 5 * fact(4) fact(4) = 4 * fact(3) fact(3) = 3 * fact(2) Each function waits for the recursive call to return fact(2) = 2 * fact(1) fact(1) = 1 * fact(0) fact(0) = 1 fact(1) = 1 * 1 = 1 fact(2) = 2 * 1 = 2 fact(4) = 4 * 6 = 24 fact(5) = 5 * 24 = 120 fact(3) = 3 * 2 = 6 Each function uses the value from the recursive call to calculate and return its factorial ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 4

5 Tail Recursion The Factorial function is an example of what s called tail recursion, where each call results in either no recursion (the base case), or one recursive call in an expression Tail recursion produces a sequence, called a stack of pending procedure calls Tail recursion can always be replaced by iteration, which generally consumes less resources ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 5

6 The Dark Side of Recursion Recursion often gets a bad name because implementing some algorithms directly produces horribly inefficient code that reevaluates things over and over. Classic case is the Fibonacci sequence*: Function BadFib(n As Integer) As Long If n <= 1 Then Else End If BadFib = 1 End Function BadFib = BadFib(n-1) + BadFib(n-2) * Regrettably, this is the solution to Chapra s misguided exercise 6, page 417 ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 6

7 tree has n levels Why BadFib is Bad Tracing calls on BadFib produces a tree rather than a simple stack of calls: F(3) is evaluated three times independently F(5) F(6) F(4) F(4) F(3) F(3) F(2) F(3) F(2) F(2) F(1) F(2) F(1) F(1) F(0) F(2) F(1) F(1) F(0) F(1) F(0) F(1) F(0) F(1) F(0) ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 7

8 Recursion in Nature Some things in nature contain elements that are smaller copies of themselves (this is called self-similarity). The branching patterns of creeks and rivers, ferns, cloud patterns and blood vessels are all examples. Anne Burns (Long Island University) has a nice paper on the web (ref below) describing general techniques for creating images such as this one. Nothing in the picture is real. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 8

9 Fractals Although fractals are not necessarily recursive, they also show self-similarity. This is my favourite, a Newton-Raphson fractal: The picture shows part of the complex plane (Re ±1.6, Im ±1.2). Colours represent how many iterations the N-R algorithm* takes to find a cube root of 1 given that starting point. The dark blue dots are the three roots. Colour coding: blue=1 to 3 iterations, yellow=8, red=12, white=16+. * The Newton-Raphson algorithm for finding the roots of f (x) was described in the lecture on iteration (week 7, slide 8). It applies to complex as well as real functions. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 9

10 Fractal Self-Similarity More detail is revealed (with the same repeated alien patterns) as the limits are adjusted. The final version s area is 0.06 x 0.04, and white now represents 21+ iterations. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 10

11 Recursive Drawings We can do a tiny bit of this with the simple drawing tools available in VBA Draw a simple figure, then one or more smaller copies positioned relative to the larger one Copies are drawn recursively Recursion stops when the elements get small enough that the detail can t be seen Can t (easily) convert to iteration unless only one copy (e.g., picture of A- series paper sizes) Source: Wikipedia ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 11

12 pic: Sierpinski Gasket One of the simplest fractals is the Sierpinski gasket, which consists of a triangle with smaller inverted triangular cutouts. Each level removes (or overlays) a white triangle, then applies the same algorithm recursively to each of the surrounding black regions Number of black triangles at depth n is 3 n, but how many white inverted triangles are there? try the Java applet at ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 12

13 Recursive Drawing Procedure General approach: Sub DrawThing(x As Single, y As Single, size As Single) If size < MIN_SIZE Then End If Exit Sub draw figure at position (x, y) ' calculate position of first copy x1 = : y1 = DrawThing(x1, y1, size*scale_factor) ' same for other copies DrawThing(x1, y1, size*scale_factor) End Sub Constant describing the smallest effective size Constant describing the reduction in size for each copy ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 13

14 H-Trees The following is from the Princeton reference. Recursive graphics. Simple recursive drawing schemes can lead to pictures that are remarkably intricate. For example, an H-tree of order n is defined as follows: The base case is do nothing for n = 0. The reduction step is to draw, within the unit square three lines in the shape of the letter H [then] four H-trees of order n 1, one connected to each tip of the H with the additional provisos that the H-trees of order n 1 are centered in the four quadrants of the square, halved in size. Question: What size will the entire picture be compared to the first H? (This is related to Zeno s Paradox about Achilles and the Tortoise) ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 14

15 size H-Trees Apart from drawing a canvas, the algorithm for drawing an H-Tree centred on (x,y) is just (x+hsize,y-hsize) HTree(x,y,size) :- If size < MIN_SIZE Then Exit Sub End If hsize = size/2 ' half-size Draw horizontal line through (x,y) of length size Draw vertical lines through (x-hsize,y) and (x+hsize,y) HTree x-hsize, y+hsize, hsize ' bottom left HTree x-hsize, y-hsize, hsize ' top left HTree x+hsize, y-hsize, hsize ' top right HTree x+hsize, y+hsize, hsize ' bottom right (x,y) Use a separate subprogram to draw the lines, so you can apply the attributes consistently and once only hsize ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 15

16 H-Tree Demo See the demo workbook. To make it more useful as a learning tool, the following have been added a ClearDrawing subroutine a DrawCanvas subroutine (shape reference saved) a depth parameter, indicating how many calls are active colours, derived from the depth a visible stack, showing the depth in boxes timings, to demonstrate inefficiencies in VBA s collections Most important parts are the subprograms DrawHTree, HTree itself and DrawLine Depending on your processor, the picture will take a couple of minutes to draw, and the drawing rate will slow down as each line is added to the shape collection. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 16

17 Office Interfacing All MS Office applications can start and interact with any other Office app For example, Excel can start Word and transfer data from a sheet to a table Word can start Outlook and send s (if an server is available) Excel can obtain data from an Access database (though this requires a lot of fiddling around) Other kinds of interface (if you re interested) Loading data into Excel from a table on a web page (but easier via the UI) Opening a browser window with a specified URL (which may include parameters) ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 17

18 Example: Creating a Word Doc ' Example adapted from Shepherd, Excel VBA Sub Test_Word() Dim objwordapp As Word.Application ' reference to Word (the app) Dim objworddoc As Word.Document ' ref to a newly created doc Set objwordapp = CreateObject("Word.Application") Set objworddoc = objwordapp.documents.add With objworddoc.sections(1).range.text = "My new Word Document".SaveAs "c:\mytest.doc" ' must use full pathname.close End With ' These are required to make sure MS Word shuts down completely Set objworddoc = Nothing Set objwordapp = Nothing End Sub ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 18

19 Object Reference Settings Unfortunately this fails to satisfy the compiler. The error points to Word.Application Select Tools References on the VBE menu, scroll to Microsoft Word 12 * Object Library and check. Press OK. * or largest value: 10=Office2002, 11=Office2003, 12=Office2007, 14 = Office2010 (there is no 13!) ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 19

20 Worked Examples 1 This is the end of the new VBA material (all together now, a big groan of disappointment) Some short worked examples of the kind that could be set for the final exam will follow. A bearing is an angle measured clockwise from North A back bearing is the bearing that is exactly opposite a given bearing. Bearings lie between 0 and 360 degrees. For example, if I'm sighting a landmark at that has a compass bearing of 110 degrees (slightly South of East), the back bearing is 290 degrees (slightly North of West). The back bearing is the bearing from the landmark back to me. Write a VBA function BackBearing that returns the back bearing for any given bearing, expressed in degrees between 0.0 (inclusive) and (exclusive). ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 20

21 Worked Examples 2 Write a VBA subprogram that candy-stripes the active worksheet. Candy-striping fills the background of every second row with a faint grey colour. Stop with the first empty cell in column A. Use the macro recorder to gather information about colouring rows, then work on the loop to apply the fills. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 21

22 3 Worked Examples A worksheet contains rainfall data for Liverpool, NSW for the month of April 2009, downloaded from A domestic water tank is fed from the guttering of a house. Given the roof area, tank capacity and initial amount of water in the tank, complete the worksheet using a VBA procedure. Assume no water is drawn from the tank over the month. Analysis: how much water does 1mm of rain produce per m 2 of area? Named cells RoofArea and TankCapacity VBA fills in this column ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 22

23 Summary Recursion is a natural way to express some algorithms tail recursion can be replaced by iteration care must be taken to avoid recursion that re-evaluates the same thing over and over drawing recursive pictures may help in understanding how recursion works Sometimes you need to think creatively about solutions Office apps can create and manipulate documents and data through the use each other s object models expressed in VBA. ENGG1811 UNSW, CRICOS Provider No: 00098G W10 slide 23

This Week. Trapezoidal Rule, theory. Warmup Example: Numeric Integration. Trapezoidal Rule, pseudocode. Trapezoidal Rule, implementation

This Week. Trapezoidal Rule, theory. Warmup Example: Numeric Integration. Trapezoidal Rule, pseudocode. Trapezoidal Rule, implementation This Week ENGG8 Computing for Engineers Week 9 Recursion, External Application Interfacing Monday: numeric integration example, then first part of the material Wednesday 9am: rest of the new material Wednesday

More information

Mathematics 350 Section 6.3 Introduction to Fractals

Mathematics 350 Section 6.3 Introduction to Fractals Mathematics 350 Section 6.3 Introduction to Fractals A fractal is generally "a rough or fragmented geometric shape that is self-similar, which means it can be split into parts, each of which is (at least

More information

2.3 Recursion 7/21/2014 5:12:34 PM

2.3 Recursion 7/21/2014 5:12:34 PM 3 Recursion Introduction to Programming in Java: An Interdisciplinary Approach Robert Sedgewick and Kevin Wayne Copyright 2002 2010 7/21/2014 5:12:34 PM Factorial The factorial of a positive integer N

More information

European Computer Driving Licence. Advanced Spreadsheet Software BCS ITQ Level 3. Syllabus Version 2.0

European Computer Driving Licence. Advanced Spreadsheet Software BCS ITQ Level 3. Syllabus Version 2.0 ECDL Advanced European Computer Driving Licence Advanced Spreadsheet Software BCS ITQ Level 3 Using Microsoft Excel 2010 Syllabus Version 2.0 This training, which has been approved by BCS, The Chartered

More information

Transformation, tessellation and symmetry line symmetry

Transformation, tessellation and symmetry line symmetry Transformation, tessellation and symmetry line symmetry Reflective or line symmetry describes mirror image, when one half of a shape or picture matches the other exactly. The middle line that divides the

More information

Surveying Prof. Bharat Lohani Indian Institute of Technology, Kanpur. Lecture - 1 Module - 6 Triangulation and Trilateration

Surveying Prof. Bharat Lohani Indian Institute of Technology, Kanpur. Lecture - 1 Module - 6 Triangulation and Trilateration Surveying Prof. Bharat Lohani Indian Institute of Technology, Kanpur Lecture - 1 Module - 6 Triangulation and Trilateration (Refer Slide Time: 00:21) Welcome to this another lecture on basic surveying.

More information

Computer Graphics Fundamentals. Jon Macey

Computer Graphics Fundamentals. Jon Macey Computer Graphics Fundamentals Jon Macey jmacey@bournemouth.ac.uk http://nccastaff.bournemouth.ac.uk/jmacey/ 1 1 What is CG Fundamentals Looking at how Images (and Animations) are actually produced in

More information

(Refer Slide Time: 02.06)

(Refer Slide Time: 02.06) Data Structures and Algorithms Dr. Naveen Garg Department of Computer Science and Engineering Indian Institute of Technology, Delhi Lecture 27 Depth First Search (DFS) Today we are going to be talking

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Formatting a spreadsheet means changing the way it looks to make it neater and more attractive. Formatting changes can include modifying number styles, text size and colours. Many

More information

Rotated earth or when your fantasy world goes up side down

Rotated earth or when your fantasy world goes up side down Rotated earth or when your fantasy world goes up side down A couple of weeks ago there was a discussion started if Fractal Terrain 3 (FT3) can rotate our earth. http://forum.profantasy.com/comments.php?discussionid=4709&page=1

More information

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples ENGG1811 UNSW, CRICOS Provider No: 00098G W6 slide 1 References ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text)

More information

Name: Tutor s

Name: Tutor s Name: Tutor s Email: Bring a couple, just in case! Necessary Equipment: Black Pen Pencil Rubber Pencil Sharpener Scientific Calculator Ruler Protractor (Pair of) Compasses 018 AQA Exam Dates Paper 1 4

More information

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples References ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder Week 8 Objects and Collections; Using the Macro Recorder; Shapes Note: there is very limited

More information

APCS-AB: Java. Recursion in Java December 12, week14 1

APCS-AB: Java. Recursion in Java December 12, week14 1 APCS-AB: Java Recursion in Java December 12, 2005 week14 1 Check point Double Linked List - extra project grade Must turn in today MBCS - Chapter 1 Installation Exercises Analysis Questions week14 2 Scheme

More information

CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion

CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion CSCI-1200 Data Structures Spring 2018 Lecture 7 Order Notation & Basic Recursion Review from Lectures 5 & 6 Arrays and pointers, Pointer arithmetic and dereferencing, Types of memory ( automatic, static,

More information

Teach Yourself Microsoft PowerPoint Topic 4: Slide Master, Comments and Save Options

Teach Yourself Microsoft PowerPoint Topic 4: Slide Master, Comments and Save Options Teach Yourself Microsoft PowerPoint Topic 4: Slide Master, Comments and Save Options http://www.gerrykruyer.com This week you will work with slide masters, add comments, find out how to save your presentations

More information

Chapter 2 Assignment (due Thursday, April 19)

Chapter 2 Assignment (due Thursday, April 19) (due Thursday, April 19) Introduction: The purpose of this assignment is to analyze data sets by creating histograms and scatterplots. You will use the STATDISK program for both. Therefore, you should

More information

Department of Computer Science Yale University Office: 314 Watson Closely related to mathematical induction.

Department of Computer Science Yale University Office: 314 Watson Closely related to mathematical induction. 2/6/12 Overview CS 112 Introduction to Programming What is recursion? When one function calls itself directly or indirectly. (Spring 2012) Why learn recursion? New mode of thinking. Powerful programming

More information

CS 112 Introduction to Programming

CS 112 Introduction to Programming CS 112 Introduction to Programming (Spring 2012) Lecture #13: Recursion Zhong Shao Department of Computer Science Yale University Office: 314 Watson http://flint.cs.yale.edu/cs112 Acknowledgements: some

More information

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES UNIT 12 PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES (A) Main Concepts and Results Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines,

More information

How to Open Excel. Introduction to Excel TIP: Right click Excel on list and select PIN to Start Menu. When you open Excel, a new worksheet opens

How to Open Excel. Introduction to Excel TIP: Right click Excel on list and select PIN to Start Menu. When you open Excel, a new worksheet opens Introduction to Excel 2010 What is Excel? It is a Microsoft Office computer software program to organize and analyze numbers, data and labels in spreadsheet form. Excel makes it easy to translate data

More information

ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions

ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions ENGG1811 UNSW, CRICOS Provider No: 00098G1 W7 slide 1 References Chapra (Part 2 of ENGG1811 Text)

More information

Excel. Spreadsheet functions

Excel. Spreadsheet functions Excel Spreadsheet functions Objectives Week 1 By the end of this session you will be able to :- Move around workbooks and worksheets Insert and delete rows and columns Calculate with the Auto Sum function

More information

MathZoom, Summer, 2014

MathZoom, Summer, 2014 A one-dimensional bug starts at the origin and each minute moves either left or right exactly one unit. Suppose it makes there moves with equal likelihood. That is the probability of a move to the left

More information

Ms Excel Vba Continue Loop Through Range Of

Ms Excel Vba Continue Loop Through Range Of Ms Excel Vba Continue Loop Through Range Of Rows Learn how to make your VBA code dynamic by coding in a way that allows your 5 Different Ways to Find The Last Row or Last Column Using VBA In Microsoft

More information

ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration

ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration ENGG1811 Computing for Engineers Week 9 Dialogues and Forms Numerical Integration ENGG1811 UNSW, CRICOS Provider No: 00098G W9 slide 1 References & Info Chapra (Part 2 of ENGG1811 Text) Topic 21 (chapter

More information

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples

ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder. Examples References ENGG1811 Computing for Engineers Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder Week 8 Objects and Collections; Using the Macro Recorder; Shapes ENGG1811 VBA Reference

More information

UNIT 5A Recursion: Basics. Recursion

UNIT 5A Recursion: Basics. Recursion UNIT 5A Recursion: Basics 1 Recursion A recursive function is one that calls itself. Infinite loop? Not necessarily. 2 1 Recursive Definitions Every recursive definition includes two parts: Base case (non

More information

Angles, Straight Lines and Symmetry

Angles, Straight Lines and Symmetry Mathematics GCSE Module Five: Basic Geometry Lesson Fifteen Angles, Straight Lines and Symmetry Aims The aim of this lesson is to enable you to: recognise and apply the basic ideas of Geometry, particularly

More information

: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics

: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Assignment 1: Turtle Graphics Page 1 600.112: Intro Programming for Scientists and Engineers Assignment 1: Turtle Graphics Peter H. Fröhlich phf@cs.jhu.edu Joanne Selinski joanne@cs.jhu.edu Due Date: Wednesdays

More information

Using Excel to produce graphs - a quick introduction:

Using Excel to produce graphs - a quick introduction: Research Skills -Using Excel to produce graphs: page 1: Using Excel to produce graphs - a quick introduction: This handout presupposes that you know how to start Excel and enter numbers into the cells

More information

Mesh Generation. Quadtrees. Geometric Algorithms. Lecture 9: Quadtrees

Mesh Generation. Quadtrees. Geometric Algorithms. Lecture 9: Quadtrees Lecture 9: Lecture 9: VLSI Design To Lecture 9: Finite Element Method To http://www.antics1.demon.co.uk/finelms.html Lecture 9: To Lecture 9: To component not conforming doesn t respect input not well-shaped

More information

Spreadsheet Warm Up for SSAC Geology of National Parks Modules, 2: Elementary Spreadsheet Manipulations and Graphing Tasks

Spreadsheet Warm Up for SSAC Geology of National Parks Modules, 2: Elementary Spreadsheet Manipulations and Graphing Tasks University of South Florida Scholar Commons Tampa Library Faculty and Staff Publications Tampa Library 2009 Spreadsheet Warm Up for SSAC Geology of National Parks Modules, 2: Elementary Spreadsheet Manipulations

More information

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe

How shapes are represented in 3D Graphics. Aims and objectives By the end of the lecture you will be able to describe Today s lecture Today we will learn about The mathematics of 3D space vectors How shapes are represented in 3D Graphics Modelling shapes as polygons Aims and objectives By the end of the lecture you will

More information

26 Feb Recursion. Overview. Greatest Common Divisor. Greatest Common Divisor. Greatest Common Divisor. Greatest Common Divisor

26 Feb Recursion. Overview. Greatest Common Divisor. Greatest Common Divisor. Greatest Common Divisor. Greatest Common Divisor Overview.3 Recursion What is recursion? When one function calls itself directly or indirectly. Why learn recursion? New mode of thinking. Powerful programming paradigm. Many computations are naturally

More information

9. a. 11. A = 30 cm 2, P = 30 cm. 12. A = 29 cm 2, P = 13. A = 72 in. 2, P = 35 in.

9. a. 11. A = 30 cm 2, P = 30 cm. 12. A = 29 cm 2, P = 13. A = 72 in. 2, P = 35 in. Answers Applications. Area = 20 cm 2 (base = 5 cm, height = cm), perimeter = 20 cm (Each side is 5 cm.) 2. Area = 9 cm 2 (base = 3 cm, height = 3 cm), perimeter 2. cm (The side lengths are 3 cm and ~ 3.2

More information

Teaching Engineering Analysis Using VBA for Excel. Abstract. Introduction

Teaching Engineering Analysis Using VBA for Excel. Abstract. Introduction Teaching Engineering Analysis Using VBA for Excel Terrence L. Chambers Department of Mechanical Engineering University of Louisiana at Lafayette PO Box 44170 Lafayette, LA 70504-4170 (337) 482-6731 (337)

More information

Year 6 Summer Term Week 1 to 2 Geometry: Properties of Shapes

Year 6 Summer Term Week 1 to 2 Geometry: Properties of Shapes Measure with a protractor Introduce angles Calculate angles Vertically opposite angles Angles in a triangle Angles in a triangle special cases Angles in a triangle missing angles Angles in special quadrilaterals

More information

Unit 5: Recursive Thinking

Unit 5: Recursive Thinking AP Computer Science Mr. Haytock Unit 5: Recursive Thinking Topics: I. Recursion II. Computational limits III. Recursion in graphics Materials: I. Hein ch. 3.2 II. Rawlins: Towers of Hanoi III. Lewis &

More information

Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7

Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7 Turtle Graphics and L-systems Informatics 1 Functional Programming: Tutorial 7 Heijltjes, Wadler Due: The tutorial of week 9 (20/21 Nov.) Reading assignment: Chapters 15 17 (pp. 280 382) Please attempt

More information

ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells

ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells ENGG1811 Computing for Engineers Week 6 Iteration; Sequential Algorithms; Processing Cells ENGG1811 UNSW, CRICOS Provider No: 00098G1 W6 slide 1 Why loops in programming? Let us hear from Mark Zuckerberg

More information

2.3 Recursion 7/23/2015 3:06:35 PM

2.3 Recursion 7/23/2015 3:06:35 PM 3 Recursion Introduction to Programming in Java: An Interdisciplinary Approach Robert Sedgewick and Kevin Wayne Copyright 2002 2010 7/23/2015 3:06:35 PM Factorial The factorial of a positive integer N

More information

Introduction to Software Development (ISD) Week 3

Introduction to Software Development (ISD) Week 3 Introduction to Software Development (ISD) Week 3 Autumn term 2012 Aims of Week 3 To learn about while, for, and do loops To understand and use nested loops To implement programs that read and process

More information

Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P

Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines, a line which passes through the point P and parallel to l, can be drawn. A triangle can be

More information

Microsoft Excel 2013: Part 3 More on Formatting Cells And Worksheet Basics. To apply number formatting:

Microsoft Excel 2013: Part 3 More on Formatting Cells And Worksheet Basics. To apply number formatting: Microsoft Excel 2013: Part 3 More on Formatting Cells And Worksheet Basics Formatting text and numbers In Excel, you can apply specific formatting for text and numbers instead of displaying all cell content

More information

Table of Contents. Tip 1: Page setup 3. Tip 2: Printing different ranges in a spreadsheet 5. Tip 3: Ensuring that a long formula is displayed 6

Table of Contents. Tip 1: Page setup 3. Tip 2: Printing different ranges in a spreadsheet 5. Tip 3: Ensuring that a long formula is displayed 6 Table of Contents Tip 1: Page setup 3 Tip 2: Printing different ranges in a spreadsheet 5 Tip 3: Ensuring that a long formula is displayed 6 Tip 4: Displaying two worksheets at the same time 7 Tip 5: How

More information

Year. Small Steps Guidance and Examples. Block 1 Properties of Shapes. Released March 2018

Year. Small Steps Guidance and Examples. Block 1 Properties of Shapes. Released March 2018 Released March 2018 The sequence of small steps has been produced by White Rose Maths. White Rose Maths gives permission to schools and teachers to use the small steps in their own teaching in their own

More information

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples References ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text) Topic 19 (chapter 12) Loops Topic 17 (section 10.1)

More information

Describe the Squirt Studio

Describe the Squirt Studio Name: Recitation: Describe the Squirt Studio This sheet includes both instruction sections (labeled with letters) and problem sections (labeled with numbers). Please work through the instructions and answer

More information

COMP1000 / Spreadsheets Week 2 Review

COMP1000 / Spreadsheets Week 2 Review / Spreadsheets Week 2 Review Plot chart Column chart/bar chart/pie chart Customize chart Chart style/labels/titles Add trendline Create table Create table/apply different style/print table Sort/filter

More information

Right Angle Triangle. Square. Opposite sides are parallel

Right Angle Triangle. Square. Opposite sides are parallel Triangles 3 sides ngles add up to 18⁰ Right ngle Triangle Equilateral Triangle ll sides are the same length ll angles are 6⁰ Scalene Triangle ll sides are different lengths ll angles are different Isosceles

More information

Teach Yourself Microsoft Office Excel Topic 17: Revision, Importing and Grouping Data

Teach Yourself Microsoft Office Excel Topic 17: Revision, Importing and Grouping Data www.gerrykruyer.com Teach Yourself Microsoft Office Excel Topic 17: Revision, Importing and Grouping Data In this topic we will revise several basics mainly through discussion and a few example tasks and

More information

6.001 Notes: Section 4.1

6.001 Notes: Section 4.1 6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,

More information

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects

Mathematics 308 Geometry. Chapter 9. Drawing three dimensional objects Mathematics 308 Geometry Chapter 9. Drawing three dimensional objects In this chapter we will see how to draw three dimensional objects with PostScript. The task will be made easier by a package of routines

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

It is useful for the user of this software to keep in mind the following points:

It is useful for the user of this software to keep in mind the following points: Instructions for the Polynomiography Java Applet It is useful for the user of this software to keep in mind the following points: This software allows you to create images of polynomial equations such

More information

2013 Four-by-Four Competition Thursday, January 31st, Round Four-by-Four Competition Thursday, January 31st, 2013.

2013 Four-by-Four Competition Thursday, January 31st, Round Four-by-Four Competition Thursday, January 31st, 2013. Round 1 Round 1 1. What is the sum of the terms of an infinite geometric sequence with first term 2016 and common ratio? 2. In how many distinguishable ways can five extra copies of your sided house key

More information

Chapter 2 Assignment (due Thursday, October 5)

Chapter 2 Assignment (due Thursday, October 5) (due Thursday, October 5) Introduction: The purpose of this assignment is to analyze data sets by creating histograms and scatterplots. You will use the STATDISK program for both. Therefore, you should

More information

Creating a Box-and-Whisker Graph in Excel: Step One: Step Two:

Creating a Box-and-Whisker Graph in Excel: Step One: Step Two: Creating a Box-and-Whisker Graph in Excel: It s not as simple as selecting Box and Whisker from the Chart Wizard. But if you ve made a few graphs in Excel before, it s not that complicated to convince

More information

Self-Teach Exercises: Getting Started Turtle Python

Self-Teach Exercises: Getting Started Turtle Python Self-Teach Exercises: Getting Started Turtle Python 0.1 Select Simple drawing with pauses Click on the Help menu, point to Examples 1 drawing, counting, and procedures, and select the first program on

More information

Data. Selecting Data. Sorting Data

Data. Selecting Data. Sorting Data 1 of 1 Data Selecting Data To select a large range of cells: Click on the first cell in the area you want to select Scroll down to the last cell and hold down the Shift key while you click on it. This

More information

Unit 8 Geometry I-1. Teacher s Guide for Workbook 8.1 COPYRIGHT 2010 JUMP MATH: NOT TO BE COPIED

Unit 8 Geometry I-1. Teacher s Guide for Workbook 8.1 COPYRIGHT 2010 JUMP MATH: NOT TO BE COPIED Unit 8 Geometry In this unit, students will identify and plot points in all four quadrants of the Cartesian plane, and perform and describe transformations (reflections, rotations, translations) in the

More information

Using Microsoft Word. Working With Objects

Using Microsoft Word. Working With Objects Using Microsoft Word Many Word documents will require elements that were created in programs other than Word, such as the picture to the right. Nontext elements in a document are referred to as Objects

More information

Excel 2013 Intermediate

Excel 2013 Intermediate Instructor s Excel 2013 Tutorial 2 - Charts Excel 2013 Intermediate 103-124 Unit 2 - Charts Quick Links Chart Concepts Page EX197 EX199 EX200 Selecting Source Data Pages EX198 EX234 EX237 Creating a Chart

More information

This document should only be used with the Apple Macintosh version of Splosh.

This document should only be used with the Apple Macintosh version of Splosh. Splosh 1 Introduction Splosh is an easy to use art package that runs under both Microsoft Windows and the Macintosh Mac OS Classic or Mac OS X operating systems. It should however be noted that the Apple

More information

Excel Tips for Compensation Practitioners Month 1

Excel Tips for Compensation Practitioners Month 1 Excel Tips for Compensation Practitioners Month 1 Introduction This is the first of what will be a weekly column with Excel tips for Compensation Practitioners. These tips will cover functions in Excel

More information

Range Objects and the ActiveCell

Range Objects and the ActiveCell Range Objects and the Active Review Objects have two important features that we can make use of Properties Methods Talk does not cook rice. Chinese Proverb 2 Review Review There is a very precise syntax

More information

Using Flash Animation Basics

Using Flash Animation Basics Using Flash Contents Using Flash... 1 Animation Basics... 1 Exercise 1. Creating a Symbol... 2 Exercise 2. Working with Layers... 4 Exercise 3. Using the Timeline... 6 Exercise 4. Previewing an animation...

More information

Charts in Excel 2003

Charts in Excel 2003 Charts in Excel 2003 Contents Introduction Charts in Excel 2003...1 Part 1: Generating a Basic Chart...1 Part 2: Adding Another Data Series...3 Part 3: Other Handy Options...5 Introduction Charts in Excel

More information

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides.

version staff had them to share viewing this this user guide. >Reports, as Logging In the SQL login User Name for your district. perform the guides. This report is available for use by all administrative and teaching staff. Data presented in the report is organized by teacher s rosters. The report has been shown to several districts and the teaching

More information

Chapter 13. Creating Business Diagrams with SmartArt. Creating SmartArt Diagrams

Chapter 13. Creating Business Diagrams with SmartArt. Creating SmartArt Diagrams Chapter 13 Creating Business Diagrams with SmartArt Office 2007 adds support for 80 different types of business diagrams. These diagrams include list charts, process charts, cycle charts, hierarchy and

More information

How to Create a For Next Loop in Excel VBA!

How to Create a For Next Loop in Excel VBA! Often when writing VBA code, one may need to repeat the same action or series of actions more than a couple of times. One could, in this case, write each action over and over in one s code or alternatively

More information

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments

References. Parameters revisited. Reference Parameters. Example: Swapping values. Named Arguments References ENGG1811 Computing for Engineers Week 8 Objects and Collections; Using the Macro Recorder; Shapes Chapra (Part 2 of ENGG1811 Text) Topic 10 (chapter 3) Macro Recorder ENGG1811 UNSW, CRICOS Provider

More information

Spreadsheet Concepts: Creating Charts in Microsoft Excel

Spreadsheet Concepts: Creating Charts in Microsoft Excel Spreadsheet Concepts: Creating Charts in Microsoft Excel lab 6 Objectives: Upon successful completion of Lab 6, you will be able to Create a simple chart on a separate chart sheet and embed it in the worksheet

More information

(Refer Slide Time: 00:02:00)

(Refer Slide Time: 00:02:00) Computer Graphics Prof. Sukhendu Das Dept. of Computer Science and Engineering Indian Institute of Technology, Madras Lecture - 18 Polyfill - Scan Conversion of a Polygon Today we will discuss the concepts

More information

2016 ACM ICPC Southeast USA Regional Programming Contest. Division 1

2016 ACM ICPC Southeast USA Regional Programming Contest. Division 1 206 ACM ICPC Southeast USA Regional Programming Contest Division Alphabet... Base Sums... 2 Buggy Robot... 3 Enclosure... 5 Illumination... 6 InTents... 7 Islands... 9 Paint... 0 Periodic Strings... Water...

More information

IP4 - Running reports

IP4 - Running reports To assist with tracking and monitoring HRIS recruitment and personnel, reports can be run from Discoverer Plus. This guide covers the following process steps: Logging in... 2 What s changed? Changed reference

More information

Lastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software.

Lastly, in case you don t already know this, and don t have Excel on your computers, you can get it for free through IT s website under software. Welcome to Basic Excel, presented by STEM Gateway as part of the Essential Academic Skills Enhancement, or EASE, workshop series. Before we begin, I want to make sure we are clear that this is by no means

More information

1. Complete these exercises to practice creating user functions in small sketches.

1. Complete these exercises to practice creating user functions in small sketches. Lab 6 Due: Fri, Nov 4, 9 AM Consult the Standard Lab Instructions on LEARN for explanations of Lab Days ( D1, D2, D3 ), the Processing Language and IDE, and Saving and Submitting. Rules: Do not use the

More information

Outline. Writing Functions and Subs. Review Immediate (1-line) Errors. Quiz Two on Thursday (2/23) Same Code Without Option Explicit

Outline. Writing Functions and Subs. Review Immediate (1-line) Errors. Quiz Two on Thursday (2/23) Same Code Without Option Explicit Writing Functions and Subs Larry Caretto Mechanical Engineering 209 Computer Programming for Mechanical Engineers February 21, 2017 Outline Review Debugging and Option Explicit What are functions and subs?

More information

I/A Series Software Spreadsheet

I/A Series Software Spreadsheet I/A Series Software Spreadsheet The I/A Series Spreadsheet is an interactive, easy-to-use tool, that allows process operators, engineers, and managers to manipulate data in a row/column format and graph

More information

mith College Computer Science Week 13 CSC111 Spring 2018 Dominique Thiébaut

mith College Computer Science Week 13 CSC111 Spring 2018 Dominique Thiébaut mith College Computer Science Week 13 CSC111 Spring 2018 Dominique Thiébaut dthiebaut@smith.edu Recursion Continued Visiting a Maze Start Exit How do we represent a maze in Python? mazetext = """ #########################...#

More information

Week - 01 Lecture - 04 Downloading and installing Python

Week - 01 Lecture - 04 Downloading and installing Python Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 01 Lecture - 04 Downloading and

More information

1. One-third of 105 is the same as seven-sixths of what number? 1.

1. One-third of 105 is the same as seven-sixths of what number? 1. Blitz, Page. One-third of 05 is the same as seven-sixths of what number?. 2. A rectangle has length 6 and width 2. What is the radius of the 2. units circle that passes through the four vertices of the

More information

Coordinates - Activity 1 Plotting whole number ordered pairs.

Coordinates - Activity 1 Plotting whole number ordered pairs. Name: Class: p 3 Maths Helper Plus Resource Set 1. Copyright 2002 Bruce A. Vaughan, Teachers Choice Software Coordinates - Activity 1 Plotting whole number ordered pairs. 1) Start Maths Helper Plus and

More information

Overview. What is recursion? When one function calls itself directly or indirectly.

Overview. What is recursion? When one function calls itself directly or indirectly. 1 2.3 Recursion Overview What is recursion? When one function calls itself directly or indirectly. Why learn recursion? New mode of thinking. Powerful programming paradigm. Many computations are naturally

More information

A Tutorial for Excel 2002 for Windows

A Tutorial for Excel 2002 for Windows INFORMATION SYSTEMS SERVICES Writing Formulae with Microsoft Excel 2002 A Tutorial for Excel 2002 for Windows AUTHOR: Information Systems Services DATE: August 2004 EDITION: 2.0 TUT 47 UNIVERSITY OF LEEDS

More information

Lecture 19: Recursion

Lecture 19: Recursion Lecture 19: Recursion Building Java Programs: A Back to Basics Approach by Stuart Reges and Marty Stepp Copyright (c) Pearson 2013. All rights reserved. Recursion recursion: The definition of an operation

More information

Ms Excel Vba Continue Loop Through Columns Range

Ms Excel Vba Continue Loop Through Columns Range Ms Excel Vba Continue Loop Through Columns Range Learn how to make your VBA code dynamic by coding in a way that allows your 5 Different Ways to Find The Last Row or Last Column Using VBA In Microsoft

More information

CSV Roll Documentation

CSV Roll Documentation CSV Roll Documentation Version 1.1 March 2015 INTRODUCTION The CSV Roll is designed to display the contents of a Microsoft Excel worksheet in a Breeze playlist. The Excel worksheet must be exported as

More information

Microsoft Excel XP. Intermediate

Microsoft Excel XP. Intermediate Microsoft Excel XP Intermediate Jonathan Thomas March 2006 Contents Lesson 1: Headers and Footers...1 Lesson 2: Inserting, Viewing and Deleting Cell Comments...2 Options...2 Lesson 3: Printing Comments...3

More information

Reflections, Translations, and Dilations

Reflections, Translations, and Dilations Reflections, Translations, and Dilations Step 1: Graph and label the following points on your coordinate plane. A (2,2) B (2,8) C (8,8) D (8,2) Step 2: Step 3: Connect the dots in alphabetical order to

More information

outlook-vba #outlookvba

outlook-vba #outlookvba outlook-vba #outlookvba Table of Contents About 1 Chapter 1: Getting started with outlook-vba 2 Remarks 2 Examples 2 Introduction 2 Outlook Visual Basic for Applications 3 Advanced topics 3 Chapter 2:

More information

5 th Grade Hinojosa Math Vocabulary Words

5 th Grade Hinojosa Math Vocabulary Words Topic 1 Word Definition Picture value The place of a digit in a number tells the value digit The symbols of 0,1,2,3,4,5,6,7,8, and 9 used to write numbers standard form A number written with one digit

More information

a function that calls itself It doesn t do anything! Defining a recursive function 1) divide and conquer 2) base case 6/21/2018 chapter 15

a function that calls itself It doesn t do anything! Defining a recursive function 1) divide and conquer 2) base case 6/21/2018 chapter 15 a function that calls itself chapter 15 Recursion: Another Control Mechanism The very basic meaning of a recursive function is a function that calls itself Leads to some funny definitions: Def: recursion.

More information

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples

References. Iteration For. Iteration (Repetition) Iteration While. For loop examples References ENGG1811 Computing for Engineers Week 7 Iteration; Sequential Algorithms; Strings and Built-in Functions Chapra (Part 2 of ENGG1811 Text) Topic 19 (chapter 12) Loops Topic 17 (section 10.1)

More information

Section 8 Formatting

Section 8 Formatting Section 8 Formatting By the end of this Section you should be able to: Format Numbers, Dates & Percentages Change Cell Alignment and Rotate Text Add Borders and Colour Change Row Height and Column Width

More information

Computer Graphics 4731 Lecture 5: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Computer Graphics 4731 Lecture 5: Fractals. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI) Computer Graphics 4731 Lecture 5: Fractals Prof Emmanuel Agu Computer Science Dept. Worcester Polytechnic Institute (WPI What are Fractals? Mathematical expressions to generate pretty pictures Evaluate

More information

Recursion. Overview. Mathematical induction. Hello recursion. Recursion. Example applications. Goal: Compute factorial N! = 1 * 2 * 3...

Recursion. Overview. Mathematical induction. Hello recursion. Recursion. Example applications. Goal: Compute factorial N! = 1 * 2 * 3... Recursion Recursion Overview A method calling itself A new way of thinking about a problem Divide and conquer A powerful programming paradigm Related to mathematical induction Example applications Factorial

More information

Stage 1 Intermediate Revision Sheet

Stage 1 Intermediate Revision Sheet Stage 1 Intermediate Revision Sheet This document attempts to sum up the contents of the Intermediate Tier Stage 1 Module. There are two exams, each 25 minutes long. One allows use of a calculator and

More information