Lecture 2 8/24/18. Computer Memory. Computer Memory. Goals for today. Computer Memory. Computer Memory. Variables Assignment Sequential Steps

Size: px
Start display at page:

Download "Lecture 2 8/24/18. Computer Memory. Computer Memory. Goals for today. Computer Memory. Computer Memory. Variables Assignment Sequential Steps"

Transcription

1 Goals for toda Lecture 2 Variables Assignment Sequential Steps Sequential Steps, Variables, Assignment Computer Memor If we can t remember things, we can t actuall do ver much Computers have memor the abilit to remember information Computer Memor Computer memor is organied in a hierarch As ou go higher in the hierarch, the memor becomes slower to access, but ou get more, and it is more permanent Offline Memor (e.g. Cloud) Secondar Memor (Files) Main Memor Cache (near CPU) CPU - registers Slower to Access More total data More long-lasting Faster to Access Less total data Less permanent Computer Memor When we sa memor, we ll be referring to main memor Offline Memor (e.g. Cloud) Secondar Memor (Files) Main Memor Cache (near CPU) CPU - registers Slower to Access More total data More long-lasting Faster to Access Less total data Less permanent Computer Memor Later in the course, we ll talk about handling files Offline Memor (e.g. Cloud) Secondar Memor (Files) Main Memor Cache (near CPU) CPU - registers Slower to Access More total data More long-lasting Faster to Access Less total data Less permanent 1

2 Computer Memor We ll ignore the lowest levels of memor in this class. Offline Memor (e.g. Cloud) Secondar Memor (Files) Main Memor Cache (near CPU) CPU - registers Slower to Access More total data More long-lasting Faster to Access Less total data Less permanent Main Memor Think of main memor as being a bunch of boes that hold information. We will call these boes of memor variables Main Memor Variables and Names The (Pthon) rules for naming A variable (a bo of memor) can hold some unit of information e.g. a number, like the number 19 We need a wa to refer to a particular variable, to distinguish it from the other boes of memor. This will be the variable name. e.g. Think of the name as the label for the bo 19 Names can start with a letter (lowercase or uppercase) or an underscore (_). But, ou generall shouldn t start them with an _ since this tends to impl certain things about the variable. The name can contain letters (lowercase or uppercase), numbers, and underscore characters. The name cannot be a reserved keword These are special commands reserved for the langu itself. The include words like for and while. You will learn these as ou learn to program. Naming Variables and Constants The importance of names So ou could name all our variables to minimie tping e.g. a, b, c, But this would result in confusion later what do these mean? A better wa of thinking about variable (and other) names ou choose in code is to think of communicating with other people You are communicating with anone ou are sharing the code with, including anone who has to take over our code But most importantl to ou, ou are communicating with the future ou the ou that will have forgotten man of the details of the code ou are going back to after doing other things Names help us understand the world, identif particular things, and so on. In computers, the name of a variable distinguishes one particular bo of memor. But, a good name can give more information about the purpose for that piece of memor. Just because a name is valid, doesn t mean it s good. 2

3 Are these names valid and good? abcde Age m_name M_Name MName 2nd_name name_2nd Winner! F0rTheW1n _densit Gig Em Gig Em Gig-Em Gig_Em Valid but not good (meaningless) Valid and good Valid and good Valid and good (and different from previous) Valid and good (and different from previous) Not valid (starts with a number) Valid, and probabl good Not valid (contains!) Valid, but not good (digits are confusing) Valid, probabl not good (begins with _) Not valid (contains ) Not valid (contains a space) Not valid (contains a -) Valid, but probabl not good (not clear what it contains) More about naming Generall, pick descriptive names Volume might be a better choice than V Not too long, though Volume_of_the_sphere is probabl too long V_sphere, or VolSphere, or Vsphere, etc. might be better names There are a few conventions people use: Constants (that never change) often in ALL_CAPITALS Variables i, j, and k often used for counting or indeing Variables tpicall start with lower-case letters Determining the Variables You Need: Mapping Problems to Software Mapping problems to software representations involves answering a number of questions. What question are ou tring to answer using the software? What are the characteristics of the problem that affect the outcome? How do the affect the outcome and how do the interact? Who is using the software ou re creating? Answers to the second question are likel to help determining what variables our software will have The other questions affect the design and the individual operations Problem Taken from Your Own Life One of the most important skills engineering students need is to be able to effectivel allocate their time to their studies. What questions do we want to answer? How effective are man short, a middle number of medium-length, or a few long stud sessions? How might other aspects of ourselves affect the outcome? What characteristics affect the outcome? The length of stud sessions The number of stud sessions How tired, stressed, hungr, etc. ou are Names for our Stud Session Problem Important concepts/values Time spent studing in a session t advant is it is short, disadvant is it is ambiguous with lots of other concepts time better, but this could be time of starting stud session, time of da, etc. length more accurate, but could be confusing because most often associated with phsical dimensions session_length even better, but what is the units (seconds, minutes, hours) session_length_min good tr, but could be read as the minimum length of a session session_length_minutes prett likel to be understood, of course, it is now a long name Rate of learning concepts/skills concepts_per_minute Number of concepts learned in a session concepts_learned_in_session Writing software requires trade-offs One that will be apparent throughout this course is the trade-off between ease of comprehension and compactness Variable Values When we see a variable name in a program, that is a placeholder for the value contained in that variable s bo of memor. : sa the variable holds value 19. What would be the value of +? + = 19+ = 22 19

4 Assignment The process of sticking a value into the bo of memor is called assignment. Can assign to an variable new or old When a new value is assigned to a variable, the old value disappears it is replaced b the new one Can (and often does) happen man times for the same variable Assignment statements Pthon assignment statements have the form: <Variable name> = <Value to assign> 19 Assign 0 to 0 Assignment statements Pthon assignment statements have the form: <Variable name> = <Value to assign> The left hand side is the variable name for the bo in memor that will hold the value. Assignment statements Pthon assignment statements have the form: <Variable name> = <Value to assign> The = is the assignment operator. It is NOT the equals sign, though we still often read it aloud as equals. We can read it aloud as gets or is assigned Assignment statements Pthon assignment statements have the form: <Variable name> = <Value to assign> The right hand side of the assignment operator is the value that will be assigned to the bo Assignment statements Pthon assignment statements have the form: <Variable name> = <Value to assign> When this statement is eecuted: We FIRST evaluate the right hand side Then, we assign that value to the left hand side Some eamples follow 19 4

5 =+1 10 =+1 1. We first find what is the value in variable, which is. 2. Then, we add +1 to get 4.. Then, we assign the value of 4 to variable, replacing the value previousl stored there. 4 =+2* =+2* 1. We first find what is the value in variables and, which are and Then, we multipl 2 times (order of operations!), to get 10.. Then, we add to 10, to get Then, we assign that value, 1, to variable, replacing the value previousl stored there. =+1 10 =+1 1. We first find what is the value in variable, which is Then, we add 10+1 to get 11.. Then, we assign the value of 11 to variable, replacing the value previousl stored there. 11

6 =+1 Notice: the use of the same variable on the right and left side is not a problem! While this statement would make no sense if the = reall meant equals, it makes perfect sense since = is actuall an assignment operation. 11 Giving Instructions If ou were asked to give a stranger directions from one place to another, how would ou do it? Drive straight to the net light Turn right Drive 1 mile Take the entrance ramp to the highwa Drive until eit 91 This is a sequence of steps that the person should follow Sequential Steps Sequential Steps We are used to giving and receiving instructions as a sequential series of steps. This is a ver important process learning how to break up a comple task in various was is critical to programming, and to dealing with an large project Including man parts of engineering One of the main was this is done is to create a sequence of steps You ll get some practice with this in lab We are used to giving and receiving instructions as a sequential series of steps. When we give instructions to a computer, we ll do the same thing Our instructions will be a sequence of steps that we want the computer to do We can think of the computer as mindlessl following those instructions, in the order the re specified Later, we will see was of giving instructions that aren t sequential! Assignment sequences Assignment sequences What is the value of at the end? (i.e. what is the value stored in the variable named = = =1 What is the value of at the end? (i.e. what is the value stored in the variable named Net = = =1 It can be helpful to keep track of the instruction pointer that is, what the net instruction to be eecuted is. We can think of the program as being at these points between statements. This starts out in front of the first statement. 6

7 Assignment sequences Assignment sequences What is the value of at the end? (i.e. what is the value stored in the variable named What is the value of at the end? (i.e. what is the value stored in the variable named Net = = =1 After the first statement is eecuted, the variable has the value stored inside. Net = = =1 After the second statement, has the value. Assignment sequences Assignment sequences (2) Net What is the value of at the end? (i.e. what is the value stored in the variable named = After the third statement, is 1. = =1 1 What is the value of at the end? (i.e. what is the value stored in the variable named = = = =1 Assignment sequences (2) Assignment sequences (2) Net What is the value of at the end? (i.e. what is the value stored in the variable named = = = =1 Net What is the value of at the end? (i.e. what is the value stored in the variable named = = = =1 7

8 Assignment sequences (2) Assignment sequences (2) Net What is the value of at the end? (i.e. what is the value stored in the variable named = = = =1 Net What is the value of at the end? (i.e. what is the value stored in the variable named = = = =1 Notice that the value of changed, but NOT the value of. The third statement, assigning = was just assigning the current value of to, not making forever equivalent to. 1 Assignment sequences () Assignment sequences () PI.1419 PI PI=.1419 r=. volume=pi*r*r*r*(4/) r Net PI=.1419 r=. volume=pi*r*r*r*(4/) r volume volume Assignment sequences () Assignment sequences ().1419 PI.1419 PI Net PI=.1419 r=. volume=pi*r*r*r*(4/) r. Net PI=.1419 r=. volume=pi*r*r*r*(4/) r. volume volume 8

9 2 =2 = =* =+2 =* =+1 Net =2 = =* =+2 =* = Net =2 = =* =+2 =* =+1 Net =2 = =* =+2 =* = Net =2 = =* =+2 =* =+1 Net =2 = =* =+2 =* =

10 Net =2 = =* =+2 =* = Special Assignment Operators Certain tpes of operations are ver common. Because of this, some special assignment operators have been defined. = + c Can be written: += c Means, for the variable on the left, increment b the amount on right Similarl for: -=, *=, /=, etc. e.g. a-= means a=a- Assignment sequences () Assignment sequences () 2 =2 = *=4 +=7* =+ -=+1 Net =2 = *=4 +=7* =+ -=+1 Assignment sequences () 2 Assignment sequences () 8 Net =2 = *=4 +=7* =+ -=+1 Net =2 = *=4 +=7* =+ -=+1 The variable gets its prior value,, multiplied b 4. This was equivalent to: =*4 10

11 Assignment sequences () Assignment sequences () 8 8 Net =2 = *=4 +=7* =+ -=+1 The variable has its value incremented b 7 times the value of, or 6. This was equivalent to: =+7* 9 Net =2 = *=4 +=7* =+ -= Assignment sequences () A reminder of output Net =2 = *=4 +=7* =+ -=+1 The variable has its value decremented b the value of plus one. This was equivalent to: =-(+1) Basic output is to the console a window or the screen that shows the output of the program. To show the value of a variable, we print it Command is: print() where is the thing ou want to be printed. The can be: a constant fied value (a literal ) a variable or an epression a combination of literals, constants, variables, functions, etc. that compute to a single value Output Output To print the value of a variable, then, we will write print(), where is the variable name. : The following program a = 10 b = 2**4 b -= a c = b//2 print(c) To print the value of a variable, then, we will write print(), where is the variable name. : The following program a = 10 b = 2**4 b -= a c = b//2 print(c) Outputs:???? Outputs: 11

12 This week s Lab and Assignment Goal is to practice variable manipulation and sequential statements 12

Monday, September 28, 2015

Monday, September 28, 2015 Monda, September 28, 2015 Topics for toda Chapter 6: Mapping High-level to assembl-level The Pep/8 run-time stack (6.1) Stack-relative addressing (,s) SP manipulation Stack as scratch space Global variables

More information

Optional: Building a processor from scratch

Optional: Building a processor from scratch Optional: Building a processor from scratch In this assignment we are going build a computer processor from the ground up, starting with transistors, and ending with a small but powerful processor. The

More information

Week 3. Topic 5 Asymptotes

Week 3. Topic 5 Asymptotes Week 3 Topic 5 Asmptotes Week 3 Topic 5 Asmptotes Introduction One of the strangest features of a graph is an asmptote. The come in three flavors: vertical, horizontal, and slant (also called oblique).

More information

Overfitting, Model Selection, Cross Validation, Bias-Variance

Overfitting, Model Selection, Cross Validation, Bias-Variance Statistical Machine Learning Notes 2 Overfitting, Model Selection, Cross Validation, Bias-Variance Instructor: Justin Domke Motivation Suppose we have some data TRAIN = {(, ), ( 2, 2 ),..., ( N, N )} that

More information

Lesson 11 Skills Maintenance. Activity 1. Model. The addition problem is = 4. The subtraction problem is 5 9 = 4.

Lesson 11 Skills Maintenance. Activity 1. Model. The addition problem is = 4. The subtraction problem is 5 9 = 4. Lesson Skills Maintenance Lesson Planner Vocabular Development -coordinate -coordinate point of origin Skills Maintenance ddition and Subtraction of Positive and Negative Integers Problem Solving: We look

More information

LINEAR PROGRAMMING. Straight line graphs LESSON

LINEAR PROGRAMMING. Straight line graphs LESSON LINEAR PROGRAMMING Traditionall we appl our knowledge of Linear Programming to help us solve real world problems (which is referred to as modelling). Linear Programming is often linked to the field of

More information

Pre-Algebra Notes Unit 8: Graphs and Functions

Pre-Algebra Notes Unit 8: Graphs and Functions Pre-Algebra Notes Unit 8: Graphs and Functions The Coordinate Plane A coordinate plane is formed b the intersection of a horizontal number line called the -ais and a vertical number line called the -ais.

More information

M O T I O N A N D D R A W I N G

M O T I O N A N D D R A W I N G 2 M O T I O N A N D D R A W I N G Now that ou know our wa around the interface, ou re read to use more of Scratch s programming tools. In this chapter, ou ll do the following: Eplore Scratch s motion and

More information

y = f(x) x (x, f(x)) f(x) g(x) = f(x) + 2 (x, g(x)) 0 (0, 1) 1 3 (0, 3) 2 (2, 3) 3 5 (2, 5) 4 (4, 3) 3 5 (4, 5) 5 (5, 5) 5 7 (5, 7)

y = f(x) x (x, f(x)) f(x) g(x) = f(x) + 2 (x, g(x)) 0 (0, 1) 1 3 (0, 3) 2 (2, 3) 3 5 (2, 5) 4 (4, 3) 3 5 (4, 5) 5 (5, 5) 5 7 (5, 7) 0 Relations and Functions.7 Transformations In this section, we stud how the graphs of functions change, or transform, when certain specialized modifications are made to their formulas. The transformations

More information

Wednesday, February 19, 2014

Wednesday, February 19, 2014 Wednesda, Februar 19, 2014 Topics for toda Solutions to HW #2 Topics for Eam #1 Chapter 6: Mapping High-level to assembl-level The Pep/8 run-time stack Stack-relative addressing (,s) SP manipulation Stack

More information

Flux Integrals. Solution. We want to visualize the surface together with the vector field. Here s a picture of exactly that:

Flux Integrals. Solution. We want to visualize the surface together with the vector field. Here s a picture of exactly that: Flu Integrals The pictures for problems # - #4 are on the last page.. Let s orient each of the three pictured surfaces so that the light side is considered to be the positie side. Decide whether each of

More information

Lecture 4 8/24/18. Expressing Procedural Knowledge. Procedural Knowledge. What are we going to cover today? Computational Constructs

Lecture 4 8/24/18. Expressing Procedural Knowledge. Procedural Knowledge. What are we going to cover today? Computational Constructs What are we going to cover today? Lecture 4 Conditionals and Boolean Expressions What is procedural knowledge? Boolean expressions The if-else and if-elif-else statements s Procedural Knowledge We differentiate

More information

Topic 2 Transformations of Functions

Topic 2 Transformations of Functions Week Topic Transformations of Functions Week Topic Transformations of Functions This topic can be a little trick, especiall when one problem has several transformations. We re going to work through each

More information

2.2 Absolute Value Functions

2.2 Absolute Value Functions . Absolute Value Functions 7. Absolute Value Functions There are a few was to describe what is meant b the absolute value of a real number. You ma have been taught that is the distance from the real number

More information

Introduction to Homogeneous Transformations & Robot Kinematics

Introduction to Homogeneous Transformations & Robot Kinematics Introduction to Homogeneous Transformations & Robot Kinematics Jennifer Ka Rowan Universit Computer Science Department. Drawing Dimensional Frames in 2 Dimensions We will be working in -D coordinates,

More information

Announcements. CSCI 334: Principles of Programming Languages. Lecture 19: C++

Announcements. CSCI 334: Principles of Programming Languages. Lecture 19: C++ Announcements CSCI 4: Principles of Programming Languages Lecture 19: C++ HW8 pro tip: the HW7 solutions have a complete, correct implementation of the CPS version of bubble sort in SML. All ou need to

More information

Lecture 12 Date:

Lecture 12 Date: Information Technolog Delhi Lecture 2 Date: 3.09.204 The Signal Flow Graph Information Technolog Delhi Signal Flow Graph Q: Using individual device scattering parameters to analze a comple microwave network

More information

Algebra I. Linear Equations. Slide 1 / 267 Slide 2 / 267. Slide 3 / 267. Slide 3 (Answer) / 267. Slide 4 / 267. Slide 5 / 267

Algebra I. Linear Equations. Slide 1 / 267 Slide 2 / 267. Slide 3 / 267. Slide 3 (Answer) / 267. Slide 4 / 267. Slide 5 / 267 Slide / 67 Slide / 67 lgebra I Graphing Linear Equations -- www.njctl.org Slide / 67 Table of ontents Slide () / 67 Table of ontents Linear Equations lick on the topic to go to that section Linear Equations

More information

Section 2.2: Absolute Value Functions, from College Algebra: Corrected Edition by Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a

Section 2.2: Absolute Value Functions, from College Algebra: Corrected Edition by Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Section.: Absolute Value Functions, from College Algebra: Corrected Edition b Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Creative Commons Attribution-NonCommercial-ShareAlike.0 license.

More information

Lecture 4. Conditionals and Boolean Expressions

Lecture 4. Conditionals and Boolean Expressions Lecture 4 Conditionals and Boolean Expressions What are we going to cover today? What is procedural knowledge? Boolean expressions The if-else and if-elif-else statements Examples Procedural Knowledge

More information

SECTION 3-4 Rational Functions

SECTION 3-4 Rational Functions 20 3 Polnomial and Rational Functions 0. Shipping. A shipping bo is reinforced with steel bands in all three directions (see the figure). A total of 20. feet of steel tape is to be used, with 6 inches

More information

CMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics

CMSC 425: Lecture 10 Basics of Skeletal Animation and Kinematics : Lecture Basics of Skeletal Animation and Kinematics Reading: Chapt of Gregor, Game Engine Architecture. The material on kinematics is a simplification of similar concepts developed in the field of robotics,

More information

Lecture 2. Variables & Assignment

Lecture 2. Variables & Assignment Lecture 2 Variables & Assignment Announcements for Today If Not Done Already Enroll in Piazza Sign into CMS Fill out the Survey Complete AI Quiz Read the tetbook Chapter 1 (browse) Chapter 2 (in detail)

More information

Properties and Definitions

Properties and Definitions Section 0.1 Contents: Operations Defined Multiplication as an Abbreviation Visualizing Multiplication Commutative Properties Parentheses Associative Properties Identities Zero Product Answers to Exercises

More information

Exponential Functions. Christopher Thomas

Exponential Functions. Christopher Thomas Mathematics Learning Centre Eponential Functions Christopher Thomas c 1998 Universit of Sdne Mathematics Learning Centre, Universit of Sdne 1 1 Eponential Functions 1.1 The functions =2 and =2 From our

More information

Introduction to Homogeneous Transformations & Robot Kinematics

Introduction to Homogeneous Transformations & Robot Kinematics Introduction to Homogeneous Transformations & Robot Kinematics Jennifer Ka, Rowan Universit Computer Science Department Januar 25. Drawing Dimensional Frames in 2 Dimensions We will be working in -D coordinates,

More information

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology Intermediate Algebra Gregg Waterman Oregon Institute of Technolog c 2017 Gregg Waterman This work is licensed under the Creative Commons Attribution 4.0 International license. The essence of the license

More information

Find the Relationship: An Exercise in Graphical Analysis

Find the Relationship: An Exercise in Graphical Analysis Find the Relationship: An Eercise in Graphical Analsis In several laborator investigations ou do this ear, a primar purpose will be to find the mathematical relationship between two variables. For eample,

More information

12.4 The Ellipse. Standard Form of an Ellipse Centered at (0, 0) (0, b) (0, -b) center

12.4 The Ellipse. Standard Form of an Ellipse Centered at (0, 0) (0, b) (0, -b) center . The Ellipse The net one of our conic sections we would like to discuss is the ellipse. We will start b looking at the ellipse centered at the origin and then move it awa from the origin. Standard Form

More information

Polynomial and Rational Functions

Polynomial and Rational Functions Polnomial and Rational Functions Figure -mm film, once the standard for capturing photographic images, has been made largel obsolete b digital photograph. (credit film : modification of work b Horia Varlan;

More information

The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development

The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development The Department of Engineering Science The University of Auckland Welcome to ENGGEN 131 Engineering Computation and Software Development Chapter 1 An Introduction to MATLAB Course Information (from Course

More information

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed

More information

Lesson 12: Sine 5 = 15 3

Lesson 12: Sine 5 = 15 3 Lesson 12: Sine How did ou do on that last worksheet? Is finding the opposite side and adjacent side of an angle super-duper eas for ou now? Good, now I can show ou wh I wanted ou to learn that first.

More information

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Determining the 2d transformation that brings one image into alignment (registers it) with another. And Last two lectures: Representing an image as a weighted combination of other images. Toda: A different kind of coordinate sstem change. Solving the biggest problem in using eigenfaces? Toda Recognition

More information

Graphs and Functions

Graphs and Functions CHAPTER Graphs and Functions. Graphing Equations. Introduction to Functions. Graphing Linear Functions. The Slope of a Line. Equations of Lines Integrated Review Linear Equations in Two Variables.6 Graphing

More information

Double Integrals in Polar Coordinates

Double Integrals in Polar Coordinates Double Integrals in Polar Coordinates. A flat plate is in the shape of the region in the first quadrant ling between the circles + and +. The densit of the plate at point, is + kilograms per square meter

More information

2.3 Polynomial Functions of Higher Degree with Modeling

2.3 Polynomial Functions of Higher Degree with Modeling SECTION 2.3 Polnomial Functions of Higher Degree with Modeling 185 2.3 Polnomial Functions of Higher Degree with Modeling What ou ll learn about Graphs of Polnomial Functions End Behavior of Polnomial

More information

PROBLEM SOLVING WITH EXPONENTIAL FUNCTIONS

PROBLEM SOLVING WITH EXPONENTIAL FUNCTIONS Topic 21: Problem solving with eponential functions 323 PROBLEM SOLVING WITH EXPONENTIAL FUNCTIONS Lesson 21.1 Finding function rules from graphs 21.1 OPENER 1. Plot the points from the table onto the

More information

What are the rules of elementary algebra

What are the rules of elementary algebra What are the rules of elementar algebra James Davenport & Chris Sangwin Universities of Bath & Birmingham 7 Jul 2010 Setting A relativel traditional mathematics course, at, sa first-ear undergraduate level.

More information

Section 4.3 Features of a Line

Section 4.3 Features of a Line Section.3 Features of a Line Objectives In this section, ou will learn to: To successfull complete this section, ou need to understand: Identif the - and -intercepts of a line. Plotting points in the --plane

More information

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE

CS 450: COMPUTER GRAPHICS RASTERIZING LINES SPRING 2016 DR. MICHAEL J. REALE CS 45: COMPUTER GRAPHICS RASTERIZING LINES SPRING 6 DR. MICHAEL J. REALE OBJECT-ORDER RENDERING We going to start on how we will perform object-order rendering Object-order rendering Go through each OBJECT

More information

More Coordinate Graphs. How do we find coordinates on the graph?

More Coordinate Graphs. How do we find coordinates on the graph? Lesson Problem Solving: More Coordinate Graphs Problem Solving: More Coordinate Graphs How do we find coordinates on the graph? We use coordinates to find where the dot goes on the coordinate graph. From

More information

Using the same procedure that was used in Project 5, enter matrix A and its label into an Excel spreadsheet:

Using the same procedure that was used in Project 5, enter matrix A and its label into an Excel spreadsheet: Math 6: Ecel Lab 6 Summer Inverse Matrices, Determinates and Applications: (Stud sections, 6, 7 and in the matri book in order to full understand the topic.) This Lab will illustrate how Ecel can help

More information

2-1. The Language of Functions. Vocabulary

2-1. The Language of Functions. Vocabulary Chapter Lesson -1 BIG IDEA A function is a special tpe of relation that can be described b ordered pairs, graphs, written rules or algebraic rules such as equations. On pages 78 and 79, nine ordered pairs

More information

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides Slide Set 1 for ENCM 369 Winter 2014 Lecture Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2014 ENCM 369 W14 Section

More information

CS 403 Compiler Construction Lecture 8 Syntax Tree and Intermediate Code Generation [Based on Chapter 6 of Aho2] This Lecture

CS 403 Compiler Construction Lecture 8 Syntax Tree and Intermediate Code Generation [Based on Chapter 6 of Aho2] This Lecture CS 403 Compiler Construction Lecture 8 Snta Tree and Intermediate Code Generation [Based on Chapter 6 of Aho2] 1 This Lecture 2 1 Remember: Phases of a Compiler This lecture: Intermediate Code This lecture:

More information

Chapter 3 Part 1 Combinational Logic Design

Chapter 3 Part 1 Combinational Logic Design Universit of Wisconsin - Madison EE/omp Sci 352 igital Sstems undamentals Kewal K. Saluja and Yu Hen Hu Spring 22 hapter 3 Part ombinational Logic esign Originals b: harles R. Kime and Tom Kamisnski Modified

More information

ANGLES See the Math Notes boxes in Lessons and for more information about angle relationships.

ANGLES See the Math Notes boxes in Lessons and for more information about angle relationships. CC1 Basic Definitions Defense Practice ANGLES 2.1.1 2.1.5 Applications of geometr in everda settings often involve the measures of angles. In this chapter we begin our stud of angle measurement. After

More information

Roberto s Notes on Differential Calculus Chapter 8: Graphical analysis Section 5. Graph sketching

Roberto s Notes on Differential Calculus Chapter 8: Graphical analysis Section 5. Graph sketching Roberto s Notes on Differential Calculus Chapter 8: Graphical analsis Section 5 Graph sketching What ou need to know alread: How to compute and interpret limits How to perform first and second derivative

More information

Introduction to Trigonometric Functions. Peggy Adamson and Jackie Nicholas

Introduction to Trigonometric Functions. Peggy Adamson and Jackie Nicholas Mathematics Learning Centre Introduction to Trigonometric Functions Pegg Adamson and Jackie Nicholas c 998 Universit of Sdne Acknowledgements A significant part of this manuscript has previousl appeared

More information

Mini-Lecture 8.1 Introduction to Radicals

Mini-Lecture 8.1 Introduction to Radicals Copyright 01 Pearson Education, Inc. Mini-Lecture 8.1 Introduction to Radicals 1. Find square roots.. Find cube roots.. Find nth roots.. Approimate square roots.. Simplify radicals containing variables.

More information

Think About. Unit 5 Lesson 3. Investigation. This Situation. Name: a Where do you think the origin of a coordinate system was placed in creating this

Think About. Unit 5 Lesson 3. Investigation. This Situation. Name: a Where do you think the origin of a coordinate system was placed in creating this Think About This Situation Unit 5 Lesson 3 Investigation 1 Name: Eamine how the sequence of images changes from frame to frame. a Where do ou think the origin of a coordinate sstem was placed in creating

More information

Section 1.6: Graphs of Functions, from College Algebra: Corrected Edition by Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Creative

Section 1.6: Graphs of Functions, from College Algebra: Corrected Edition by Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Creative Section.6: Graphs of Functions, from College Algebra: Corrected Edition b Carl Stitz, Ph.D. and Jeff Zeager, Ph.D. is available under a Creative Commons Attribution-NonCommercial-ShareAlike.0 license.

More information

Week 10. Topic 1 Polynomial Functions

Week 10. Topic 1 Polynomial Functions Week 10 Topic 1 Polnomial Functions 1 Week 10 Topic 1 Polnomial Functions Reading Polnomial functions result from adding power functions 1 together. Their graphs can be ver complicated, so the come up

More information

Systems of Linear Equations

Systems of Linear Equations Sstems of Linear Equations Gaussian Elimination Tpes of Solutions A linear equation is an equation that can be written in the form: a a a n n b The coefficients a i and the constant b can be real or comple

More information

Transformations of Functions. 1. Shifting, reflecting, and stretching graphs Symmetry of functions and equations

Transformations of Functions. 1. Shifting, reflecting, and stretching graphs Symmetry of functions and equations Chapter Transformations of Functions TOPICS.5.. Shifting, reflecting, and stretching graphs Smmetr of functions and equations TOPIC Horizontal Shifting/ Translation Horizontal Shifting/ Translation Shifting,

More information

Announcements. CS 5565 Network Architecture and Protocols. Count-To-Infinity. Poisoned Reverse. Distance Vector: Link Cost Changes.

Announcements. CS 5565 Network Architecture and Protocols. Count-To-Infinity. Poisoned Reverse. Distance Vector: Link Cost Changes. Announcements CS 6 Network Architecture and Protocols Lecture 20 Project 2B Part/ due Wed Apr 27 :9pm Part/2 due Wed Ma :9pm Current reading assignment: Chapter.6.7, Chapter Final Ma 0, 3:2pm, MCB 26 Godmar

More information

4.5.2 The Distance-Vector (DV) Routing Algorithm

4.5.2 The Distance-Vector (DV) Routing Algorithm 4.5 ROUTING ALGORITHMS 371 highl congested (for eample, high-dela) links. Another solution is to ensure that not all routers run the LS algorithm at the same time. This seems a more reasonable solution,

More information

angle The figure formed by two lines with a common endpoint called a vertex. angle bisector The line that divides an angle into two equal parts.

angle The figure formed by two lines with a common endpoint called a vertex. angle bisector The line that divides an angle into two equal parts. A angle The figure formed b two lines with a common endpoint called a verte. verte angle angle bisector The line that divides an angle into two equal parts. circle A set of points that are all the same

More information

Module 2, Section 2 Graphs of Trigonometric Functions

Module 2, Section 2 Graphs of Trigonometric Functions Principles of Mathematics Section, Introduction 5 Module, Section Graphs of Trigonometric Functions Introduction You have studied trigonometric ratios since Grade 9 Mathematics. In this module ou will

More information

EECS1022 Winter 2018 Additional Notes Tracing Point, PointCollector, and PointCollectorTester

EECS1022 Winter 2018 Additional Notes Tracing Point, PointCollector, and PointCollectorTester EECS1022 Winter 2018 Additional Notes Tracing, Collector, and CollectorTester Chen-Wei Wang Contents 1 Class 1 2 Class Collector 2 Class CollectorTester 7 1 Class 1 class { 2 double ; double ; 4 (double

More information

science. In this course we investigate problems both algebraically and graphically.

science. In this course we investigate problems both algebraically and graphically. Section. Graphs. Graphs Much of algebra is concerned with solving equations. Man algebraic techniques have been developed to provide insights into various sorts of equations and those techniques are essential

More information

Variables and Constants

Variables and Constants HOUR 3 Variables and Constants Programs need a way to store the data they use. Variables and constants offer various ways to work with numbers and other values. In this hour you learn: How to declare and

More information

Grade 7/8 Math Circles Fall October 9/10/11 Angles and Light

Grade 7/8 Math Circles Fall October 9/10/11 Angles and Light Facult of Mathematics Waterloo, Ontario N2L 3G1 Grade 7/8 Math Circles Fall 2018 - October 9/10/11 Angles and Light Centre for Education in Mathematics and Computing Toda we will be learning about angles.

More information

Bias-Variance Decomposition Error Estimators

Bias-Variance Decomposition Error Estimators Bias-Variance Decomposition Error Estimators Cross-Validation Bias-Variance tradeoff Intuition Model too simple does not fit the data well a biased solution. Model too comple small changes to the data,

More information

Core Connections, Course 3 Checkpoint Materials

Core Connections, Course 3 Checkpoint Materials Core Connections, Course 3 Checkpoint Materials Notes to Students (and their Teachers) Students master different skills at different speeds. No two students learn eactl the same wa at the same time. At

More information

Bias-Variance Decomposition Error Estimators Cross-Validation

Bias-Variance Decomposition Error Estimators Cross-Validation Bias-Variance Decomposition Error Estimators Cross-Validation Bias-Variance tradeoff Intuition Model too simple does not fit the data well a biased solution. Model too comple small changes to the data,

More information

Modeling with CMU Mini-FEA Program

Modeling with CMU Mini-FEA Program Modeling with CMU Mini-FEA Program Introduction Finite element analsis (FEA) allows ou analze the stresses and displacements in a bod when forces are applied. FEA determines the stresses and displacements

More information

Graphing Calculator Graphing with the TI-86

Graphing Calculator Graphing with the TI-86 Graphing Calculator Graphing with the TI-86 I. Introduction The TI-86 has fift kes, man of which perform multiple functions when used in combination. Each ke has a smbol printed on its face. When a ke

More information

Microsoft Access: Table Properites, Complex Forms. Start with a new, blank Access database,

Microsoft Access: Table Properites, Complex Forms. Start with a new, blank Access database, : Table Properites, Complex Forms Start with a new, blank Access database, : Let s create the tblperson. We are going to use advanced properties for the table fields and create an advanced form. Add a

More information

3.9 Differentials. Tangent Line Approximations. Exploration. Using a Tangent Line Approximation

3.9 Differentials. Tangent Line Approximations. Exploration. Using a Tangent Line Approximation 3.9 Differentials 3 3.9 Differentials Understand the concept of a tangent line approimation. Compare the value of the differential, d, with the actual change in,. Estimate a propagated error using a differential.

More information

Non-linear models. Basis expansion. Overfitting. Regularization.

Non-linear models. Basis expansion. Overfitting. Regularization. Non-linear models. Basis epansion. Overfitting. Regularization. Petr Pošík Czech Technical Universit in Prague Facult of Electrical Engineering Dept. of Cbernetics Non-linear models Basis epansion.....................................................................................................

More information

Week 27 Algebra 1 Assignment:

Week 27 Algebra 1 Assignment: Week 7 Algebra Assignment: Da : p. 494 #- odd, -, 8- Da : pp. 496-497 #-9 odd, -6 Da : pp. 0-0 #-9 odd, -, -9 Da 4: p. 09 #-4, 7- Da : pp. - #-9 odd Notes on Assignment: Page 494: General notes for this

More information

Section 3.1: Introduction to Linear Equations in 2 Variables Section 3.2: Graphing by Plotting Points and Finding Intercepts

Section 3.1: Introduction to Linear Equations in 2 Variables Section 3.2: Graphing by Plotting Points and Finding Intercepts Remember to read the tetbook before attempting to do our homework. Section 3.1: Introduction to Linear Equations in 2 Variables Section 3.2: Graphing b Plotting Points and Finding Intercepts Rectangular

More information

Connecting Algebra and Geometry with Polygons

Connecting Algebra and Geometry with Polygons Connecting Algebra and Geometr with Polgons 15 Circles are reall important! Once ou know our wa around a circle, ou can use this knowledge to figure out a lot of other things! 15.1 Name That Triangle!

More information

Glossary alternate interior angles absolute value function Example alternate exterior angles Example angle of rotation Example

Glossary alternate interior angles absolute value function Example alternate exterior angles Example angle of rotation Example Glossar A absolute value function An absolute value function is a function that can be written in the form, where is an number or epression. alternate eterior angles alternate interior angles Alternate

More information

Name Course Days/Start Time

Name Course Days/Start Time Name Course Days/Start Time Mini-Project : The Library of Functions In your previous math class, you learned to graph equations containing two variables by finding and plotting points. In this class, we

More information

FRANC3D & OSM 3D Tutorial

FRANC3D & OSM 3D Tutorial FRANC3D & OSM 3D Tutorial Version 2.6 2003 1 Introduction This manual contains a tutorial eample for the programs OSM (Object Solid Modeler) and FRANC3D (FRacture ANalis Code for 3D). The capabilities

More information

Boolean Function Simplification

Boolean Function Simplification Universit of Wisconsin - Madison ECE/Comp Sci 352 Digital Sstems Fundamentals Charles R. Kime Section Fall 200 Chapter 2 Combinational Logic Circuits Part 5 Charles Kime & Thomas Kaminski Boolean Function

More information

C1M0 Introduction to Maple Assignment Format C1M1 C1M1 Midn John Doe Section 1234 Beginning Maple Syntax any

C1M0 Introduction to Maple Assignment Format C1M1 C1M1 Midn John Doe Section 1234 Beginning Maple Syntax any CM0 Introduction to Maple Our discussion will focus on Maple 6, which was developed by Waterloo Maple Inc. in Waterloo, Ontario, Canada. Quoting from the Maple 6 Learning Guide, Maple is a Symbolic Computation

More information

Test data generation for LRU cache-memory testing

Test data generation for LRU cache-memory testing Test data generation for LRU cache-memor testing Evgeni Kornikhin Moscow State Universit, Russia Email: kornevgen@gmail.com Abstract Sstem functional testing of microprocessors deals with man assembl programs

More information

2.3. One-to-One and Inverse Functions. Introduction. Prerequisites. Learning Outcomes

2.3. One-to-One and Inverse Functions. Introduction. Prerequisites. Learning Outcomes One-to-One and Inverse Functions 2. Introduction In this Section we eamine more terminolog associated with functions. We eplain one-to-one and man-to-one functions and show how the rule associated with

More information

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED

MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED FOM 11 T9 GRAPHING LINEAR EQUATIONS REVIEW - 1 MATH SPEAK - TO BE UNDERSTOOD AND MEMORIZED 1) -INTERCEPT = the point where the graph touches or crosses the -ais. It occurs when = 0. ) -INTERCEPT = the

More information

Domain of Rational Functions

Domain of Rational Functions SECTION 46 RATIONAL FU NCTIONS SKI LLS OBJ ECTIVES Find the domain of a rational function Determine vertical, horizontal, and slant asmptotes of rational functions Graph rational functions CONCE PTUAL

More information

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM

Overview. Memory Classification Read-Only Memory (ROM) Random Access Memory (RAM) Functional Behavior of RAM. Implementing Static RAM Memories Overview Memory Classification Read-Only Memory (ROM) Types of ROM PROM, EPROM, E 2 PROM Flash ROMs (Compact Flash, Secure Digital, Memory Stick) Random Access Memory (RAM) Types of RAM Static

More information

CMSC 201 Computer Science I for Majors

CMSC 201 Computer Science I for Majors CMSC 201 Computer Science I for Majors Lecture 02 Intro to Python Syllabus Last Class We Covered Grading scheme Academic Integrity Policy (Collaboration Policy) Getting Help Office hours Programming Mindset

More information

Laurie s Notes. Overview of Section 6.3

Laurie s Notes. Overview of Section 6.3 Overview of Section.3 Introduction In this lesson, eponential equations are defined. Students distinguish between linear and eponential equations, helping to focus on the definition of each. A linear function

More information

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE

CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 2015 DR. MICHAEL J. REALE CS 548: COMPUTER GRAPHICS DRAWING LINES AND CIRCLES SPRING 05 DR. MICHAEL J. REALE OPENGL POINTS AND LINES OPENGL POINTS AND LINES In OenGL, there are different constants used to indicate what ind of rimitive

More information

What s the Point? # 2 - Geo Fashion

What s the Point? # 2 - Geo Fashion What s the Point? # 2 - Geo Fashion Graph the points and connect them with line segments. Do not connect points with DNC between them. Start (-4,1) (-5,5) (-2,2) (-4,1) DNC (2,-4) (3,-3) (4,-3) (5,-4)

More information

L3 Rigid Motion Transformations 3.1 Sequences of Transformations Per Date

L3 Rigid Motion Transformations 3.1 Sequences of Transformations Per Date 3.1 Sequences of Transformations Per Date Pre-Assessment Which of the following could represent a translation using the rule T (, ) = (, + 4), followed b a reflection over the given line? (The pre-image

More information

Chapter 2 Part 5 Combinational Logic Circuits

Chapter 2 Part 5 Combinational Logic Circuits Universit of Wisconsin - Madison ECE/Comp Sci 352 Digital Sstems Fundamentals Kewal K. Saluja and Yu Hen Hu Spring 2002 Chapter 2 Part 5 Combinational Logic Circuits Originals b: Charles R. Kime and Tom

More information

Algebra I Summer Math Packet

Algebra I Summer Math Packet 01 Algebra I Summer Math Packet DHondtT Grosse Pointe Public Schools 5/0/01 Evaluate the power. 1.. 4. when = Write algebraic epressions and algebraic equations. Use as the variable. 4. 5. 6. the quotient

More information

CS559: Computer Graphics

CS559: Computer Graphics CS559: Computer Graphics Lecture 8: 3D Transforms Li Zhang Spring 28 Most Slides from Stephen Chenne Finish Color space Toda 3D Transforms and Coordinate sstem Reading: Shirle ch 6 RGB and HSV Green(,,)

More information

Grade 7/8 Math Circles Fall October 9/10/11 Angles and Light

Grade 7/8 Math Circles Fall October 9/10/11 Angles and Light Facult of Mathematics Waterloo, Ontario N2L 3G1 Grade 7/8 Math Circles Fall 2018 - October 9/10/11 Angles and Light Centre for Education in Mathematics and Computing Toda we will be learning about angles.

More information

Implementing Object-Oriented Languages. Implementing instance variable access. Implementing dynamic dispatching (virtual functions)

Implementing Object-Oriented Languages. Implementing instance variable access. Implementing dynamic dispatching (virtual functions) Implementing Object-Oriented Languages Implementing instance variable access Ke features: inheritance (possibl multiple) subtping & subtpe polmorphism message passing, dnamic binding, run-time tpe testing

More information

CS201 - Assignment 8 Due: Wednesday April 23, at the beginning of class

CS201 - Assignment 8 Due: Wednesday April 23, at the beginning of class CS201 - Assignment 8 Due: Wednesda April 23, at the beginning of class In this assignment we will pla a guessing game (somewhat similar to 20 questions), with the computer doing the guessing and learning

More information

Lecture 3. Input, Output and Data Types

Lecture 3. Input, Output and Data Types Lecture 3 Input, Output and Data Types Goals for today Variable Types Integers, Floating-Point, Strings, Booleans Conversion between types Operations on types Input/Output Some ways of getting input, and

More information

Basics of Java Programming

Basics of Java Programming Basics of Java Programming Lecture 2 COP 3252 Summer 2017 May 16, 2017 Components of a Java Program statements - A statement is some action or sequence of actions, given as a command in code. A statement

More information

Excel for Gen Chem General Chemistry Laboratory September 15, 2014

Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel for Gen Chem General Chemistry Laboratory September 15, 2014 Excel is a ubiquitous data analysis software. Mastery of Excel can help you succeed in a first job and in your further studies with expertise

More information

Cross-validation for detecting and preventing overfitting

Cross-validation for detecting and preventing overfitting Cross-validation for detecting and preventing overfitting Note to other teachers and users of these slides. Andrew would be delighted if ou found this source material useful in giving our own lectures.

More information