Chapter 1. Math review. 1.1 Some sets

Similar documents
Table of Laplace Transforms

Section 1.1 Graphs Graphs

DOWNLOAD PDF BIG IDEAS MATH VERTICAL SHRINK OF A PARABOLA

Bits, Words, and Integers

Calculus I Review Handout 1.3 Introduction to Calculus - Limits. by Kevin M. Chevalier

Chapter 3. Set Theory. 3.1 What is a Set?

A.1 Numbers, Sets and Arithmetic

AXIOMS FOR THE INTEGERS

n! = 1 * 2 * 3 * 4 * * (n-1) * n

A Prehistory of Arithmetic

EC121 Mathematical Techniques A Revision Notes

Limits and Derivatives (Review of Math 249 or 251)

Chapter 4. Number Theory. 4.1 Factors and multiples

Equations and Functions, Variables and Expressions

Number Systems Using and Converting Between Decimal, Binary, Octal and Hexadecimal Number Systems

Cardinality of Sets. Washington University Math Circle 10/30/2016

Objective- Students will be able to use the Order of Operations to evaluate algebraic expressions. Evaluating Algebraic Expressions

Section 0.3 The Order of Operations

Intermediate Algebra. Gregg Waterman Oregon Institute of Technology

Functions and Graphs. The METRIC Project, Imperial College. Imperial College of Science Technology and Medicine, 1996.

Table : IEEE Single Format ± a a 2 a 3 :::a 8 b b 2 b 3 :::b 23 If exponent bitstring a :::a 8 is Then numerical value represented is ( ) 2 = (

Basics of Computational Geometry

Section 1.2 Fractions

Integer Operations. Summer Packet 7 th into 8 th grade 1. Name = = = = = 6.

Congruence Arithmetic

Properties and Definitions

Discrete Mathematics Introduction

Matrices. Chapter Matrix A Mathematical Definition Matrix Dimensions and Notation

1.7 Limit of a Function

Summer Packet 7 th into 8 th grade. Name. Integer Operations = 2. (-7)(6)(-4) = = = = 6.

UPCAT Reviewer Booklet

Chapter 1: Number and Operations

Course Number 432/433 Title Algebra II (A & B) H Grade # of Days 120

Integers are whole numbers; they include negative whole numbers and zero. For example -7, 0, 18 are integers, 1.5 is not.

Second Edition. Concept Builders. Jana Kohout

Math 3 Coordinate Geometry Part 2 Graphing Solutions

Divisibility Rules and Their Explanations

Examination Duration Date

6.001 Notes: Section 4.1

Exploring Fractals through Geometry and Algebra. Kelly Deckelman Ben Eggleston Laura Mckenzie Patricia Parker-Davis Deanna Voss

(Refer Slide Time: 02:59)

CIS 194: Homework 6. Due Monday, February 25. Fibonacci numbers

Watkins Mill High School. Algebra 2. Math Challenge

Sets. Sets. Examples. 5 2 {2, 3, 5} 2, 3 2 {2, 3, 5} 1 /2 {2, 3, 5}

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Section 1.1 Definitions and Properties

Generating Functions

Here are some of the more basic curves that we ll need to know how to do as well as limits on the parameter if they are required.

Catalan Numbers. Table 1: Balanced Parentheses

WHOLE NUMBER AND DECIMAL OPERATIONS

Variables and Data Representation

CCNY Math Review Chapter 2: Functions

Structures of Expressions

The Practical Use of the Bemer Method for Exponentials Update Version: September 5, 2006 Ron Doerfler (

AP Calculus BC Summer Assignment

Rev Name Date. . Round-off error is the answer to the question How wrong is the rounded answer?

Example: Which of the following expressions must be an even integer if x is an integer? a. x + 5

GAP CLOSING. Grade 9. Facilitator s Guide

Here are a couple of warnings to my students who may be here to get a copy of what happened on a day that you missed.

Introduction to Scientific Computing Lecture 1

Mathematics Background

Unit 4: Multiplication

CS1114 Section 8: The Fourier Transform March 13th, 2013

Increasing/Decreasing Behavior

Increasing/Decreasing Behavior

Algebra 2 Common Core Summer Skills Packet

2/22/ Transformations but first 1.3 Recap. Section Objectives: Students will know how to analyze graphs of functions.

FUNCTIONS AND MODELS

CITS 1401 Problem Solving & Programming

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Vector Calculus: Understanding the Cross Product

Skill 1: Multiplying Polynomials

Math 221 Final Exam Review

1. Let n be a positive number. a. When we divide a decimal number, n, by 10, how are the numeral and the quotient related?

SECTION 1.3: BASIC GRAPHS and SYMMETRY

Module 2 Congruence Arithmetic pages 39 54

What Every Programmer Should Know About Floating-Point Arithmetic

Lecture Numbers. Richard E Sarkis CSC 161: The Art of Programming

6th Bay Area Mathematical Olympiad

Math 25 and Maple 3 + 4;

rrr Cu 'Vt.-1 cal l-c.-<_ {CL/o,_

Math 5320, 3/28/18 Worksheet 26: Ruler and compass constructions. 1. Use your ruler and compass to construct a line perpendicular to the line below:

A point is pictured by a dot. While a dot must have some size, the point it represents has no size. Points are named by capital letters..

MAC 1105 Fall Term 2018

Problem Set 7 Solutions

2 Sets. 2.1 Notation. last edited January 26, 2016

Output: For each size provided as input, a figure of that size is to appear, followed by a blank line.

1 Shapes of Power Functions

SOFTWARE ENGINEERING DESIGN I

Precalculus and Calculus

Honors Precalculus: Solving equations and inequalities graphically and algebraically. Page 1

Counting shapes 1.4.6

6.1 Evaluate Roots and Rational Exponents

4 Visualization and. Approximation

Paul's Online Math Notes. Online Notes / Algebra (Notes) / Systems of Equations / Augmented Matricies

A-SSE.1.1, A-SSE.1.2-

MATH STUDENT BOOK. 12th Grade Unit 4

MA 1128: Lecture 02 1/22/2018

Math Glossary Numbers and Arithmetic

Transcription:

Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric identities. However, you probably can t remember it all cold. Many useful facts can be looked up (e.g. on the internet) as you need them. This chapter reviews concepts and notation that will be used a lot in this book, as well as a few concepts that may be new but are fairly easy. 1.1 Some sets You ve all seen sets, though probably a bit informally. We ll get back to some of the formalism in a couple weeks. Meanwhile, here are the names for a few commonly used sets of numbers: Z = {..., 3, 2, 1, 0, 1, 2, 3,...} is the integers. N = {0, 1, 2, 3,...} is the non-negative integers, also known as the natural numbers. Z + = {1, 2, 3,...} is the positive integers. R is the real numbers 1

CHAPTER 1. MATH REVIEW 2 Q is the rational numbers C is the complex numbers Notice that a number is positive if it is greater than zero, so zero is not positive. If you wish to exclude negative values, but include zero, you must use the term non-negative. In this book, natural numbers are defined to include zero. Notice also that the real numbers contain the integers, so a real number is not required to have a decimal part. And, finally, infinity is not a number in standard mathematics. Remember that the rational numbers are the set of fractions p q where q can t be zero and we consider two fractions to be the same number if they are the same when you reduce them to lowest terms. The real numbers contain all the rationals, plus irrational numbers such as 2 and π. (Also e, but we don t use e much in this end of computer science.) We ll assume that x returns (only) the positive square root of x. The complex numbers are numbers of the form a + bi, where a and b are real numbers and i is the square root of -1. Some of you from ECE will be aware that there are many strange and interesting things that can be done with the complex numbers. We won t be doing that here. We ll just use them for a few examples and expect you to do very basic things, mostly easy consequences of the fact that i = 1. If we want to say that the variable x is a real, we write x R. Similarly y Z means that y is not an integer. In calculus, you don t have to think much about the types of your variables, because they are largely reals. In this class, we handle variables of several different types, so it s important to state the types explicitly. It is sometimes useful to select the real numbers in some limited range, called an interval of the real line. We use the following notation: closed interval: [a, b] is the set of real numbers from a to b, including a and b open interval: (a, b) is the set of real numbers from a to b, not including a and b

CHAPTER 1. MATH REVIEW 3 half-open intervals: [a, b) and (a, b] include only one of the two endpoints. 1.2 Pairs of reals The set of all pairs of reals is written R 2. So it contains pairs like ( 2.3, 4.7). Similarly, the set R 3 contains triples of reals such as 8, 7.3, 9. In a computer program, we implement a pair of reals using an object or struct with two fields. Suppose someone presents you with a pair of numbers (x, y) or one of the corresponding data structures. Your first question should be: what is the pair intended to represent? It might be a point in 2D space a complex number a rational number (if the second coordinate isn t zero) an interval of the real line The intended meaning affects what operations we can do on the pairs. For example, if (x, y) is an interval of the real line, it s a set. So we can write things like z (x, y) meaning z is in the interval (x, y). That notation would be meaningless if (x, y) is a 2D point or a number. If the pairs are numbers, we can add them, but the result depends on what they are representing. So (x, y) + (a, b) is (x + a, y + b) for 2D points and complex numbers. But it is (xb + ya, yb) for rationals. Suppose we want to multiply (x, y) (a, b) and get another pair as output. There s no obvious way to do this for 2D points. For rationals, the formula would be (xa, yb), but for complex numbers it s (xa yb, ya + xb). Stop back and work out that last one for the non-ece students, using more familiar notation. (x+yi)(a+bi) is xa+yai+xbi+byi 2. But i 2 = 1. So this reduces to (xa yb) + (ya + xb)i.

CHAPTER 1. MATH REVIEW 4 Oddly enough, you can also multiply two intervals of the real line. This carves out a rectangular region of the 2D plane, with sides determined by the two intervals. 1.3 Exponentials and logs Suppose that b is any real number. We all know how to take integer powers of b, i,e. b n is b multiplied by itself n times. It s not so clear how to precisely define b x, but we ve all got faith that it works (e.g. our calculators produce values for it) and it s a smooth function that grows really fast as the input gets bigger and agrees with the integer definition on integer inputs. Here are some special cases to know b 0 is one for any b. b 0.5 is b b 1 is 1 b And some handy rules for manipulating exponents: b x b y = b x+y a x b x = (ab) x (b x ) y = b xy b (xy ) (b x ) y Suppose that b > 1. Then we can invert the function y = b x, to get the function x = log b y ( logarithm of y to the base b ). Logarithms appear in computer science as the running times of particularly fast algorithms. They are also used to manipulate numbers that have very wide ranges, e.g. probabilities. Notice that the log function takes only positive numbers as inputs. In this class, log x with no explicit base always means log 2 x because analysis of computer algorithms makes such heavy use of base-2 numbers and powers of 2.

CHAPTER 1. MATH REVIEW 5 Useful facts about logarithms include: b log b (x) = x log b (xy) = log b x + log b y log b (x y ) = y log b x log b x = log a x log b a In the change of base formula, it s easy to forget whether the last term should be log b a or log a b. To figure this out on the fly, first decide which of log b x and log a x is larger. You then know whether the last term should be larger or smaller than one. One of log b a and log a b is larger than one and the other is smaller: figure out which is which. More importantly, notice that the multiplier to change bases is a constant, i.e doesn t depend on x. So it just shifts the curve up and down without really changing its shape. That s an extremely important fact that you should remember, even if you can t reconstruct the precise formula. In many computer science analyses, we don t care about constant multipliers. So the fact that base changes simply multiply by a constant means that we frequently don t have to care what the base actually is. Thus, authors often write log x and don t specify the base. 1.4 Some handy functions The factorial function may or may not be familiar to you, but is easy to explain. Suppose that k is any positive integer. Then k factorial, written k!, is the product of all the positive integers up to and including k. That is k! = 1 2 3... (k 1) k For example, 5! = 1 2 3 4 5 = 120. 0! is defined to be 1. Suppose that we have a set S containing n objects, all different. There are n! permutations of these objects, i.e. n! ways to arrange the objects into a particular order. There are n! k!(n k)! ways to choose k (unordered) elements

CHAPTER 1. MATH REVIEW 6 n! from S. The quantity is frequently abbreviated as ( n k!(n k)! k), pronounced n choose k. The max function returns the largest of its inputs. For example, suppose we define f(x) = max(x 2, 7). Then f(3) = 9 but f(2) = 7. The min function is similar. The floor and ceiling functions are heavily used in computer science, though not in many areas other of science and engineering. Both functions take a real number x as input and return an integer near x. The floor function returns the largest integer no bigger than x. In other words, it converts x to an integer, rounding down. This is written x. If the input to floor is already an integer, it is returned unchanged. Notice that floor rounds downward even for negative numbers. So: 3.75 = 3 3 = 3 3.75 = 4 The ceiling function, written x, is similar, but rounds upwards. For example: 3.75 = 4 3 = 3 3.75 = 3 Most programming languages have these two functions, plus a function that rounds to the nearest integer and one that truncates i.e. rounds towards zero. Round is often used in statistical programs. Truncate isn t used much in theoretical analyses. 1.5 Summations If a i is some formula that depends on i, then

CHAPTER 1. MATH REVIEW 7 For example a i = a 1 + a 2 + a 3 +... + a n i=1 i=1 1 2 i = 1 2 + 1 4 + 1 8... + 1 2 n Products can be written with a similar notation, e.g. n k=1 1 k = 1 1 1 2 1 3... 1 n Certain sums can be re-expressed in closed form i.e. without the summation notation. For example: i=1 1 2 i = 1 1 2 n This formula is a specific example of a pattern called a geometric series. More generally, for any real number r 1, we have For example, k=0 r k = rn+1 1 r 1 2 k = 2 n+1 1. In Calculus, you may have seen infinite k=0 versions of geometric series formulas. In this class, we re always dealing with finite sums, not infinite ones. If you modify the start value, the closed form must be adapted to add/subtract 1 the values of the extra/missing terms. For example, starts with the 2 i i=0

CHAPTER 1. MATH REVIEW 8 i = 0 term. So summation starts. i=0 1 = 2 1 2 i 2n. Always be careful to check where your Many reference books have tables of useful formulas for summations that have simple closed forms. We ll see them again when we cover mathematical induction and see how to formally prove that they are correct. Only a very small number of closed forms need to be memorized. Aside from the geometric series formula, you should also know this closed form: i = i=1 n(n + 1) 2 Here s one way to convince yourself it s right. On graph paper, draw a box n units high and n+1 units wide. Its area is n(n+1). Fill in the leftmost part of each row to represent one term of the summation: the left box in the first row, the left two boxes in the second row, and so on. This makes a little triangular pattern which fills exactly half the box. 1.6 Strings You ve probably seen strings in introductory programming, e.g. when processing input from the user or a disk file. In computer science, a string is a finite-length sequence of characters and its length is the number of characters in it. E.g. pineapple is a string of length 9. The special symbol ǫ is used for the string containing no characters, which has length 0. Zero-length strings may seem odd, but they appear frequently in computer programs that manipulate text data. For example, a program that reads a line of input from the keyboard will typically receive a zerolength string if the user types ENTER twice. We specify concatenation of strings, or concatenation of strings and individual characters, by writing them next to each other. For example, suppose that α = blue and β = cat. Then αβ would be the string bluecat and βs be the string cats.

CHAPTER 1. MATH REVIEW 9 A bit string is a string consisting of the characters 0 and 1. If A is a set of characters, then A is the set of all (finite-length) strings containing only characters from A. For example, if A contains all lower-case alphabetic characters, then A contains strings like e, onion, and kkkkmmmmmbb. It also contains the empty string ǫ. Sometimes we want to specify a pattern for a set of similar strings. We often use a shorthand notation called regular expressions. These look much like normal strings, but we can use two operations: a b means either one of the characters a and b. a means zero or more copies of the character a. Parentheses are used to show grouping. So, for example, ab specifies all strings consisting of an a followed by zero or more b s: a, ab, abb, and so forth. c(b a) c specifies all strings consisting of one c, followed by zero or more characters that are either a s or b s, followed one c. E.g. cc, cac, cbbac, and so forth. 1.7 Variation in notation Mathematical notation is not entirely standardized and has changed over the years, so you will find that different subfields and even different individual authors use slightly different notation. These variation in notation sections tell you about synonyms and changes in notation that you are very likely to encounter elsewhere. Always check carefully which convention an author is using. When doing problems on homework or exams for a class, follow the house style used in that particular class. In particular, authors differ as to whether zero is in the natural numbers. Moreover, 1 is named j over in ECE and physics, because i is used for current. Outside of computer science, the default base for logarithms is usually e, because this makes a number of continuous mathematical formulas work nicely (just as base 2 makes many computer science formulas work nicely).

CHAPTER 1. MATH REVIEW 10 In standard definitions of the real numbers and in this book, infinity is not a number. People are sometimes confused because is sometimes used in notation where numbers also occur, e.g. in defining limits in calculus. There are non-standard number systems that include infinite numbers. And points at infinity are sometimes introduced in discussions of 2D and 3D geometry. We won t make use of such extensions. Regular expressions are quite widely used in both theory and practical applications. As a result there are many variations on the notation. There are also other operations that make it easy to specify a wider range of patterns.