Morpheus: Neo, sooner or later you re going to realize, just as I did, that there s a difference between knowing the path, and walking the path.

Similar documents
Section Instructors: by now you should be scheduled into one of the following Sections:

Math 31 Lesson Plan. Day 5: Intro to Groups. Elizabeth Gillaspy. September 28, 2011

Today: Scalars and vectors Coordinate systems, Components Vector Algebra

Topics in General Chemistry Chemistry 103 Fall 2017

Alien Worlds. Astronomy 105. Spring 2011

MATH 341, Section 001 FALL 2014 Introduction to the Language and Practice of Mathematics

Discrete Mathematics. Kenneth A. Ribet. January 31, 2013

Ph 1a Fall General Information

MAT188H1S LINEAR ALGEBRA: Course Information as of February 2, Calendar Description:

Math 410 Linear Algebra Summer Session American River College

MATH 450: Mathematical statistics

Physics 2D Lecture Slides Lecture 1: Jan

1.1 Administrative Stuff

Preparing for the CS 173 (A) Fall 2018 Midterm 1

Leon, Chap. 1. Chap. 2

AS The Astronomical Universe. Prof. Merav Opher - Fall 2013

Welcome to Physics 161 Elements of Physics Fall 2018, Sept 4. Wim Kloet

Physics 162a Quantum Mechanics

Physics 2D Lecture Slides Lecture 1: Jan

Math 3B: Lecture 1. Noah White. September 23, 2016

Astronomy 1010: Survey of Astronomy. University of Toledo Department of Physics and Astronomy

Math 200 A and B: Linear Algebra Spring Term 2007 Course Description

MATH 325 LEC Q1 WINTER 2015 OUTLINE

CS173 Lecture B, November 3, 2015

Math 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011

Physics 102 Dr. LeClair

Math 416, Spring 2010 Matrix multiplication; subspaces February 2, 2010 MATRIX MULTIPLICATION; SUBSPACES. 1. Announcements

Linear algebra and differential equations (Math 54): Lecture 10

MAT 211, Spring 2015, Introduction to Linear Algebra.

Physics 2D Lecture Slides Sep 26. Vivek Sharma UCSD Physics

Math 3B: Lecture 1. Noah White. September 29, 2017

Differential Equations MTH 205

General Info. Grading

AS 102 The Astronomical Universe (Spring 2010) Lectures: TR 11:00 am 12:30 pm, CAS Room 316 Course web page:

Physics 102 Dr. LeClair

Lecture 1/25 Chapter 2

Announcements Monday, November 13

Course: Math 111 Pre-Calculus Summer 2016

Math Lecture 3 Notes

Ch. 2: Lec. 1. Basics: Outline. Importance. Usages. Key problems. Three ways of looking... Colbert on Equations. References. Ch. 2: Lec. 1.

Designing Information Devices and Systems II Fall 2018 Elad Alon and Miki Lustig Homework 9

Math 200D - Linear Algebra Fall Term 2017 Course Description

Textbook: Explorations: An Introduction to Astronomy, 4 th Edition by: Thomas T. Arny

Math 1553 Introduction to Linear Algebra. School of Mathematics Georgia Institute of Technology

Astro 32 - Galactic and Extragalactic Astrophysics/Spring 2016

Required Textbook. Grade Determined by

PHYSICS 100. Introduction to Physics. Bridges the gap between school science and Physics 101, Physics 120, Physics 125 or Physics 140

Geological Foundations of Environmental Sciences

CS 340: Discrete Structures for Engineers

AS 101: The Solar System (Spring 2017) Course Syllabus

Important Dates. Non-instructional days. No classes. College offices closed.

Announcements Monday, September 18

ABOUT THE CLASS AND NOTES ON SET THEORY

Math , Fall 2014 TuTh 12:30pm - 1:45pm MTH 0303 Dr. M. Machedon. Office: Math Office Hour: Tuesdays and

Chemistry 8 Principles of Organic Chemistry Spring Semester, 2013

Math 250B Midterm I Information Fall 2018

Chemistry 883 Computational Quantum Chemistry

Math/EECS 1028M: Discrete Mathematics for Engineers Winter Suprakash Datta

ADVENTURES IN THE FLIPPED CLASSROOM FOR INTRODUCTORY

Physics 273 (Fall 2013) (4 Credit Hours) Fundamentals of Physics II

One-to-one functions and onto functions

MAT01A1. Numbers, Inequalities and Absolute Values. (Appendix A)

Lecture 1. Econ 2001: Introduction to Mathematical Methods (a.k.a. Math Camp) 2015 August 10

Syllabus for Astronomy 152

Physics 106 Dr. LeClair

Recap from Last Time

PHYSICS 206, Spring 2019

Chemistry Physical Chemistry I Fall 2017

UNIVERSITY OF TORONTO Department of Electrical and Computer Engineering ECE320H1-F: Fields and Waves, Course Outline Fall 2013

MAT01A1. Numbers, Inequalities and Absolute Values. (Appendix A)

Calculus (Math 1A) Lecture 1

Syllabus, Math 343 Linear Algebra. Summer 2005

HOMEWORK 8 SOLUTIONS MATH 4753

ASTR 4 Solar System Astronom y

Course Staff. Textbook

CSE 241 Class 1. Jeremy Buhler. August 24,

San Jose State University Department of Mechanical and Aerospace Engineering ME 230, Advanced Mechanical Engineering Analysis, Fall 2015

Methods of Mathematics

Announcements Monday, November 13

Introduction to Oceanography Cabrillo College, Spring Semester, 2018 Instructors: David Schwartz & Lauren Hanneman

MAT01A1: Functions and Mathematical Models

CHEM 25: Organic Chemistry I (2009FA-CHEM )

Math Linear Algebra Spring Term 2014 Course Description

Supplemental Instruction

ASTR 101L: Motion of the Sun Take Home Lab

San José State University Aerospace Engineering Department AE138: Vector Based Dynamics for Aerospace Applications Fall 2018

ASTR1120L & 2030L Introduction to Astronomical Observations Spring 2019

Econ 11: Intermediate Microeconomics. Preliminaries

Instructor Dr. Tomislav Pintauer Mellon Hall Office Hours: 1-2 pm on Thursdays and Fridays, and by appointment.

GEOLOGY 10 De Anza College

Please turn cell phones off

MATH 251 Ordinary and Partial Differential Equations Summer Semester 2017 Syllabus

CHEM 102 Fall 2012 GENERAL CHEMISTRY

Wednesday, 10 September 2008

Outline. Wednesday, 10 September Schedule. Welcome to MA211. MA211 : Calculus, Part 1 Lecture 2: Sets and Functions

Week 2: Counting with sets; The Principle of Inclusion and Exclusion (PIE) 13 & 15 September 2017

Dr. Korey Haynes. 1 cardstock 5 sticky notes A colored pencil Syllabus Activity sheet Study Points sheet. On your way in please grab:

CSE 20. Lecture 4: Introduction to Boolean algebra. CSE 20: Lecture4

Announcements. CS243: Discrete Structures. Sequences, Summations, and Cardinality of Infinite Sets. More on Midterm. Midterm.

Physics 8 Monday, September 12, 2011

Transcription:

Morpheus: Neo, sooner or later you re going to realize, just as I did, that there s a difference between knowing the path, and walking the path.

Why CS 53? Making linear algebra more concrete. Making it more relevant. Taking advantage of your programming ability: you can write programs that actually do semi-useful stuff writing a program helps you understand programming experience gives you a useful perspective Goal: That vectors and matrices and orthogonal projection and eigenvalues and... become things you interact with and use almost as easily as you use a pencil or a computer or a while-loop or recursion. Aim: To understand some very cool but more advanced concepts/applications: k-means Clustering, Principal Components Analysis, image deblurring, image compression,...

CS53 Work categories 1. Quizzes: In class, on your own, including what are ordinarily considered midterm exams 2. Class activities: Like quizzes, but these are ungraded and you are encouraged to work with other students. 3. Homework: After every lecture (except the last) 4. Labs: Once a week for two hours 5. Final exam: December 16, 9:00-12:00 The workload is not high (compared to average CS class) but it is steady, and if you fall behind, you will be lost.

Quizzes Almost every day of class there will be a quiz. Quiz starts at the beginning of class. Quiz ends at the end of class. In between, there will be other things going on. Quizzes are not intended to be challenging. They are intended to keep you on top of the material.

First quiz question Tell me something interesting about yourself.

Homework After almost every lecture, you will be assigned a reading in the textbook and a few related problems. Problems due before the next class. Two kinds of problems: 1. Problems turned in on paper (CS053 hand-in bin on second floor of CIT) 2. Problems graded and turned in digitally.

First homework I will assign the first homework soon after this class. It will consist of questions about the course missive. (You must do this homework but we won t actually grade it count it towards your grade.)

Labs Every week there will be a lab. You are assigned a lab session, and you are expected to go to your lab session. Labs start tonight. The first week only, we will have lab sessions tonight and Thursday afternoon, with a make-up session Sunday. 1. Today 7-9 pm (CIT 201) 2. Thursday 4-6 pm (CIT 201) 3. Sunday 2:00-4:00 pm (CIT 201) Only go to one of these! If you cannot make it to any of these, let us know. Regular weekly labs (starting next week): 1. Monday 7-9 pm 2. Tuesday, 4-6 pm 3. Tuesday, 6:30-8:30 pm

Communication Email most questions, etc. to cs053tas@cs.brown.edu, which goes to all course staff, including professor. See course web page (csmatrix.org) forwards to it), which has course calendar, etc. Emails (e.g. with homeworks and announcements) to you if you have registered for course or have the course in your shopping cart. If you want to receive course communication but are not planning to register, email me: klein@brown.edu To make an appointment with me, talk to me after class or email me. Every student is required to come at least once to my office hours. I will organize group field trips. My office is CIT 111111111.

Course environment My aim is that this course provide a welcoming and inclusive environment. I expect everyone, including course staff and students, to be respectful and kind to each other. I want people to feel comfortable asking questions in class. However, sometimes I will need to move on. If I cannot get to your question, please write it down and let s talk about it after class. I want the environment to be relaxed and fun. I sometimes make jokes but I don t want anyone to feel that the joke is at their expense.

Keeping up The workload is not huge but it is continuous and cumulative. You need to keep up or things will not go well. You need to allocate an hour or two between each class to do the homework, review the material from last lecture, and test your knowledge.

[0] The Function (and other mathematical and computational preliminaries)

Set terminology and notation Set: an unordered collection of objects. Example: {,,, } : indicates that an object belongs to a set (equivalently, that the set contains the object). For example, {,,, }. A B: Read this as A is a subset of B. This means A and B are sets, and every element of A is also an element of B. A = B: Two sets are equal if they contain exactly the same elements. (There is no order among elements of a set.) A convenient way to prove that A and B are equal is to prove that each is a subset of the other. The proof often consists of two parts: 1. a proof that A B, and 2. a proof that B A.

Set expressions In Mathese, we would write the set of nonnegative numbers like this: {x R : x 0} Read this as The set of consisting of all elements x of the set of real numbers such that x is greater than or equal to 0 The colon stands for such that. There are two parts to this set expression: the part before the colon: This part specifies where the elements of the set come from, and introduces a variable or variables that can be used in the second part. the part after the colon: This gives a rule that restricts which elements specified in the first part actually get to make it into the set. The analogous Python expression is a set comprehension: >>> S = {-4, 4, -3, 3, -2, 2, -1, 1, 0} >>> {x for x in S if x >= 0} {0, 1, 2, 3, 4}

Set expressions Instead of {x R : x 0} you might see just {x : x 0} if it is considered clear what kind of values x is supposed to take on. Another example: {x : x 2 5 6 x + 1 6 = 0} This time, the set consists of just two numbers, 1 2 and 1 3.

Set terminology and notation Cardinality: If a set S is not infinite, we use S to denote the number of elements or cardinality of the set. For example, the set {,,, } has cardinality 4.

Set terminology and notation: Cartesian product A B is the set of all pairs (a, b) where a A and b B. Example: for A = {1, 2} and B = {,,, }, A B is {(1, ), (2, ), (1, ), (2, ), (1, ), (2, ), (1, ), (2, )} Named for René Descartes. We will meet him later.

Set terminology and notation: Cartesian product Question: What is the cardinality of A B where A = {1, 2} and B = {,,, }? Answer: 8

Set terminology and notation: Cartesian product If A and B are finite sets then A B = A B. Question: What is the cardinality of {1, 2, 3,..., 10, J, Q, K} {,,, }? Answer: 52

Tuples in set expressions The set expression {(x, y) R R : y = x 2 } denotes the set of all pairs of real numbers in which the second element of the pair is the square of the first. This set expression might be abbreviated as {(x, y) : y = x 2 } where you are supposed to guess from context that x and y range over real numbers. Another example: {(x, y, z) R R R : x 0, y 0, z 0} This is the set of triples consisting of nonnegative real numbers. To include (x, y, z), all the conditions to right of colon must be satisfied. (You can read the comma between the conditions as and.) We might abbreviate that set expression as {(x, y, z) : x 0, y 0, z 0}

What is a function? Informally, for each input element in a set A, a function assigns a single output element from another set B. A is called the domain of the function B is called the co-domain Formally, a function from A to B is a subset of the Cartesian product A B such that, for each element a A, there is exactly one element b B such that the subset contains (a, b). Example: The function with domain {1, 2, 3,...} that doubles its input is the set {(1, 2), (2, 4), (3, 6), (4, 8),...} Example: The function with domain {1, 2, 3,...} {1, 2, 3,...} that multiplies the numbers forming its input is {((1, 1), 1), (1, 2), 2), ((1, 3), 3),..., ((2, 1), 2), ((2, 2), 4), ((2, 3), 6),...}

Diagrams of functions Diagram for subset of a Cartesian product or a function: The subset {( P, 1), ( P, 2), ( Q, 2), ( R, 2), ( S, 3), ( T, 4)} of { P, Q, R, S, T, U } {0, 1, 2, 3, 4} The function {( P, 1), ( Q, 2), ( R, 2), ( S, 3), ( T, 4)} with domain { P, Q, R, S, T } and co-domain {0, 1, 2, 3, 4} 0 0 "P" "P" "Q" 1 "Q" 1 "R" 2 "R" 2 "S" 3 "S" 3 "T" "T" 4 4 "U"

Activity Draw two diagrams of subsets of the Cartesian product { P, Q } {0, 1} that illustrate the two ways a subset of the Cartesian product can fail to be a function.

Some function terminology Definition:The output of a given input is called the image of that input. The image of q under a function f is denoted f (q). If f (q) = r, we say q maps to r under f. In Mathese, we write this as q r. The set from which all the outputs are chosen is called the co-domain. We write f : A B when we want to say that f is a function with domain A and co-domain B. Note: When we define a function, we have some flexibility in the choice of co-domain. There might be elements of the co-domain that are not images of any elements of the domain.

Example: Caesar s Cryptosystem Each letter is mapped to one three places ahead, wrapping around, so MATRIX would map to PDWULA. The function mapping letter to letter can be written as: {( A, D ), ( B, E ), ( C, F ), ( D, G ),..., ( W, Z ), ( X, A ), ( Y, B ), ( Z, C )} Both the domain and co-domain are {A, B,..., Z}. Domain A B C... Z Co-domain D E F... C

Image of a function Definition: The image of a function is the set of all images of inputs. Mathese: Im f Example: Cosine Function cos(x) cos : R R, which means the domain is R and the co-domain is R The image of cos(x), Im cos, is {x R : 1 x 1}, which is not the same as the co-domain Example: The image of the Caesar encryption function is {A, B, C,..., Z}, which is the same as the co-domain. Example: a function f : {1, 2, 3, 4} { A, B, C, D, E } The image of f is Im f = { A, B, C, E } D is in the co-domain but not in the image. Some people use range to mean co-domain. Some people use range to mean image. Because it is used in both ways, I prefer to avoid the word. Domain 1 2 3 Co-domain A B C D 4 E

Set of functions with given domain and co-domain Definition: For sets F and D, F D denotes all functions from D to F. Example: The set of functions from the set W of words to the set R of real numbers is R W. Proposition: For finite sets F and D, F D = F D.

Identity function Identity function: for any domain D, maps each domain element d to itself. id D : D D 1 1 2 2 3 3 4 4

Composition Definition: For functions f : A B and g : B C, the functional composition of g and f is the function (g f ) : A C defined by (g f )(x) = g(f (x)) Example: f : {1, 2, 3} {A, B, C, D} and g : {A, B, C, D} {4, 5} f 1 A A g 4 1 f A g 4 1 g f 2 B B 2 B 4 2 3 C C 3 C 5 5 3 D D D 5 Example: Composition of g(y) = y 2 and f (x) = x + 1 is (g f )(x) = (x + 1) 2.

Function composition Example: Define the function f : {A, B, C,..., Z} {0, 1, 2,..., 25} by A 0, B 1, C 2,, Z 25 f g h A 0 3 D Define g on the domain/co-domain {0, 1, 2,..., 25} by g(x) = (x + 3) mod 26 B 1 4 E Define h with domain {0, 1, 2,..., 25} and co-domain {A,..., Z} such that 0 A, 1 B, etc. Then h (g f ) is the Caesar cypher. C... 2... 5... F... Z 25 2 C A h g f D B E

Associativity of function composition Proposition: h (g f ) = (h g) f Proof: for any element x of domain of f : (h (g f ))(x) = h((g f )(x)) by definition of h (g f )) = h(g(f (x)) by definition of g f = (h g)(f (x)) by definition of h g = ((h g) f )(x) by definition of (h g) f

Functional inverse Definition: Functions f and g are functional inverses if f g and g f are defined and are identity functions. A function that has an inverse is invertible.

One-to-one Definition: f : D F is one-to-one if f (x) = f (y) implies x = y. U V NOT ONE-TO-ONE Definition: f : D F is onto if for every z F there exists an a such that f (a) = z. U V NOT ONTO

One-to-one Definition: f : D F is one-to-one if f (x) = f (y) implies x = y. Proposition: Invertible functions are one-to-one. Proof: Assume an invertible function f is not one-to-one. So there exists x 1 x 2 where f (x 1 ) = f (x 2 ) = y. Then f 1 (y) = x 1 but f 1 (y) = x 2, and both cannot be true, by the definition of function. QED U V NOT ONE-TO-ONE

Onto Definition: f : D F is onto if for every z F there exists an element a D such that f (a) = z. Proposition: Invertible functions are onto Proof Assume an invertible function f is not onto. So there exists element ŷ in co-domain such that for no x does f (x) = ŷ. But f 1 (ŷ) = ˆx for some ˆx, and by the definition of the inverse, f (ˆx) = ŷ, a contradiction. U V QED NOT ONTO

One-to-one and onto = invertible Function Invertibility Theorem: A function f is invertible if and only if it is one-to-one and onto. Previous two propositions show that every invertible function is one-to-one and onto. It is not hard to prove that a function that is one-to-one and onto is invertible.

Activity Draw two diagrams of subsets of the Cartesian product { P, Q } {0, 1} that illustrate the two ways a function can fail to be invertible.