Skill 1: Multiplying Polynomials

Similar documents
Problem One: A Quick Algebra Review

Square Roots: Introduction & Simplification

Divisibility Rules and Their Explanations

CGF Lecture 2 Numbers

EC121 Mathematical Techniques A Revision Notes

CS103 Spring 2018 Mathematical Vocabulary

In our first lecture on sets and set theory, we introduced a bunch of new symbols and terminology.

MITOCW ocw f99-lec07_300k

Binary, Hexadecimal and Octal number system

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Section 0.3 The Order of Operations

Section 1.1 Definitions and Properties

MITOCW watch?v=0jljzrnhwoi

Post Experiment Interview Questions

Watkins Mill High School. Algebra 2. Math Challenge

MITOCW watch?v=kvtlwgctwn4

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

Integers. Integer Definition. Slide 1 / 237. Slide 2 / 237. Slide 3 / 237. Integer Unit Topics

MITOCW ocw f99-lec12_300k

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Algebra 2 Common Core Summer Skills Packet

Project 2: How Parentheses and the Order of Operations Impose Structure on Expressions

MITOCW watch?v=9h6muyzjms0

Chapter 1: Number and Operations

MITOCW watch?v=zm5mw5nkzjg

radicals are just exponents

1 Getting used to Python

The Stack, Free Store, and Global Namespace

PROFESSOR: So far in this course we've been talking a lot about data abstraction. And remember the idea is that

Hi everyone. Starting this week I'm going to make a couple tweaks to how section is run. The first thing is that I'm going to go over all the slides

CHAPTER 1: INTEGERS. Image from CHAPTER 1 CONTENTS

MITOCW watch?v=4dj1oguwtem

The following content is provided under a Creative Commons license. Your support

MITOCW watch?v=w_-sx4vr53m

MITOCW watch?v=se4p7ivcune

Instructor: Craig Duckett. Lecture 04: Thursday, April 5, Relationships

6.1 Evaluate Roots and Rational Exponents

Slide 1 Side Effects Duration: 00:00:53 Advance mode: Auto

Table of Contents. Introduction to the Math Practice Series...iv Common Mathematics Symbols and Terms...1

Note: Please use the actual date you accessed this material in your citation.

Troubleshooting Maple Worksheets: Common Problems

Math Glossary Numbers and Arithmetic

Mathematics Background

CS103 Handout 35 Spring 2017 May 19, 2017 Problem Set 7

Grade 6 Math Circles November 6 & Relations, Functions, and Morphisms

Chapter 2 Decimals and Percentages

School Year:

Algebra II Radical Equations

(Refer Slide Time 3:31)

Pre-Algebra Notes Unit Five: Rational Numbers and Equations

Is the statement sufficient? If both x and y are odd, is xy odd? 1) xy 2 < 0. Odds & Evens. Positives & Negatives. Answer: Yes, xy is odd

MA 1128: Lecture 02 1/22/2018

Topic 3: Fractions. Topic 1 Integers. Topic 2 Decimals. Topic 3 Fractions. Topic 4 Ratios. Topic 5 Percentages. Topic 6 Algebra

4. Java Project Design, Input Methods

Vocabulary: Looking For Pythagoras

Math 2 Coordinate Geometry Part 2 Lines & Systems of Equations

MITOCW watch?v=rvrkt-jxvko

Part 1 Your First Function

Algebra 1 Review. Properties of Real Numbers. Algebraic Expressions

A. Incorrect! To simplify this expression you need to find the product of 7 and 4, not the sum.

Unit 4: Multiplication

Chapter 1 Operations With Numbers

UNIT 2: RATIONAL EXPRESSIONS

Pre-Algebra Notes Unit Five: Rational Numbers; Solving Equations & Inequalities

The following content is provided under a Creative Commons license. Your support

GAP CLOSING. Grade 9. Facilitator s Guide

Fraction Arithmetic. A proper fraction is a fraction with a smaller numerator than denominator.

Mathematical Logic Part One

Rational Number is a number that can be written as a quotient of two integers. DECIMALS are special fractions whose denominators are powers of 10.

Limits. f(x) and lim. g(x) g(x)

Section 1.8. Simplifying Expressions

Mathematical Logic Part One

The Real Number System

Properties. Comparing and Ordering Rational Numbers Using a Number Line

The following content is provided under a Creative Commons license. Your support

MITOCW MIT6_172_F10_lec18_300k-mp4

!"!!!"!!"!! = 10!!!!!(!!) = 10! = 1,000,000

Math 1 Variable Manipulation Part 2 Exponents & Roots

Lecture 1: Overview

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Rational and Irrational Numbers

In math, the rate of change is called the slope and is often described by the ratio rise

(Refer Slide Time: 00:51)

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5

CSE143 Notes for Monday, 4/25/11

CIS 194: Homework 4. Due Wednesday, February 18, What is a Number?

Pre-Algebra Notes Unit One: Rational Numbers and Decimal Expansions

Lesson 6-2: Function Operations

Pre-Algebra Notes Unit Five: Rational Numbers and Equations


MITOCW watch?v=sdw8_0rdzuw

6th Grade Report Card Mathematics Skills: Students Will Know/ Students Will Be Able To...

Basic Arithmetic Operations

MITOCW watch?v=yarwp7tntl4

So on the survey, someone mentioned they wanted to work on heaps, and someone else mentioned they wanted to work on balanced binary search trees.

It Might Be Valid, But It's Still Wrong Paul Maskens and Andy Kramek

Lesson 16: Integration

Summer Math Packet for Students Going Into Pre-algebra 8

A.1 Numbers, Sets and Arithmetic

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

Transcription:

CS103 Spring 2018 Mathematical Prerequisites Although CS103 is primarily a math class, this course does not require any higher math as a prerequisite. The most advanced level of mathematics you'll need for this course is high school algebra. Anything beyond that trigonometry, complex numbers, calculus, limits, and (especially) graphing functions on a coordinate axis isn't necessary for the course and won't come up at all over the course of the quarter. In this handout, we've outlined the particular skills that we'll be assuming over the course of this class. As you'll probably find out pretty quickly in this class, the sort of math that we'll be doing looks very little like the math that you probably did in high school, so even if you are a bit shaky on these concepts, you should be fine in this class. As always, you are welcome and in fact, encouraged to come talk to us if you have any concerns about whether you're in the right place. If you would prefer to talk to me (Keith) about this directly, consider this an open invitation. Skill 1: Multiplying Polynomials Early on this course (and, surprisingly, not much beyond then), we'll assume that you know how to multiply two polynomials together. For example, in one of our early proofs, we're going to arrive at the equation and will simplify the right-hand side to get that n² = (2k)² n² = 4k². Similarly, on Friday, we'll end up with the equation n² = (2k + 1)² and will simplify the right-hand side to conclude that n² = 4k 2 + 4k + 1. Oddly enough, we won't be factoring many if any polynomials over the quarter. It's probably good to be able to recognize that n 2 + 2n + 1 happens to be equal to (n+1) 2, but I doubt we'll do anything more advanced to that. Also, we certainly won't be dividing polynomials, so don't lose any sleep over that. (Confession time: I don't actually remember how to divide polynomials off the top of my head and have never needed to do this outside of high school.)

2 / 6 Skill 2: Manipulating Equalities This skill from high school algebra is the one we'll get the most mileage out of in this class. In case you're curious about what manipulating equalities means, we're talking about things like the following. Imagine that you know that 2x + 3 = 5 and you want to solve for x. To do so, you could subtract three from both sides to get and then divide both sides by two to get that 2x = 2 x = 1. Sometimes, in CS103, we'll write out a long chain of equalities to show that two numbers or quantities happen to be equal to one another. For example, we might show that (2n+1) 2 (2n) 2 = 4n + 1 by writing out something like this: (2n+1) 2 (2n) 2 = 4n 2 + 4n + 1 4n 2 = (4n 2 4n 2 ) + 4n + 1 = 4n + 1. Here, the top line performs one simplification, and each line after that is a simplification from the previous line. The final result is that the left-hand side of the first equality ends up being equal to the righthand side of the last equality. Skill 3: Adding, Subtracting, Multiplying, and Dividing Fractions From time to time especially when we're talking about rational numbers (numbers that can be written as one integer divided by another) we'll be assuming that you're comfortable manipulating fractions. For example, you might need to add together two fractions whose numerator and denominator are given symbolically, like this: a b + c d = ad bd + bc bd = ad +cb bd Similarly, you may need to multiply two fractions together, like this: a b c d = ac bd I've always thought it's unusual that multiplying fractions is cleaner than adding fractions. Interesting how that works out..

3 / 6 Skill 4: Working with Exponents and Roots Exponents and their properties are one of those areas that often give students trouble in this course, primarily because we end up using them in ways that are a bit different from what you might be used to in high school. There are a few properties of exponents that we'll be using over the course of this class, most of which come up pretty early on (as early as Friday of the first week of class). The first is what happens if you multiply together two powers of some number x: x a x b = x a+b. This property of exponents is fundamental exponents are often used precisely because they turn multiplication into addition. In fact, some mathematicians define what it means to raise a number to a power in terms of the above equation! One special case of this result that comes up a few times in CS103 is this one: x n+1 = x x n. For example, 2 n+1 = 2 2 n = 2 n + 2 n. We'll use this specific fact when we talk about induction around the halfway point of the quarter. Another property is what happens if you raise one number to a power, then raise that to the power of another number. Specifically: (x a ) b = x ab = (x b ) a. You can see where this rule comes from in the case where a and b are positive integers by using the earlier rule about what happens when you multiply together two powers. For example, (x a ) b means x a multiplied by itself b times, so we'd expect that (x a ) b = x a x a x a (b times) = x a + a + + a (b times) = x ab. That last step happens because if you add a to itself b times, you get ab, that is, a times b. Remember how earlier we said that you could derive things just using the fact that exponents turn multiplication into addition? This is one of the cases where we do that. The last key property we'll need is the connection between roots and exponents. Let's think about what it would mean to raise something to a fractional power. For example, what is the number x ½? Well, using our previous rule, we know that (x ½ ) 2 = x 1 = x. So, in other words, whatever number x ½ is, it has the property that, when you multiply it by itself, you get x. We have another name for that number it's the square root of x! So this means that and, more generally, that x ½ = x 1 x a = a x.

4 / 6 Skill 5: Categorizing Types of Numbers If you have experience programming in a typed language like C, C++, or Java, you're probably comfortable with the idea that when working with numbers, it's important to know what kind of number you're dealing with. You use ints to hold numbers that are integers (something you'd use for counting) and doubles to store real numbers (something you'd use for measuring). The idea that there are different types of numbers that you'd use in different circumstances is fundamental in mathematics, and so throughout the quarter we'll be sure to be specific about what kinds of numbers we're using. There are a zillion flavors of numbers in math, but we'll only need to use a few of them over the course of the quarter. The numbers we'll use the most extensively throughout the quarter and which seem to get used more than any other type in all of computer science are the natural numbers. These are the numbers 0, 1, 2, 3, 4, 5,, etc. They're the whole numbers (no fractions or decimals allowed) starting at 0 and continuing on toward infinity. However, we don t consider to be a natural number. The next class of numbers we'll be using are the integers. They're basically things you can store in an int:, -3, -2, -1, 0, 1, 2, 3,, etc. Notice that every natural number is an integer, but the reverse isn't true: -1 is an integer, but it's not a natural number. As with the natural numbers, we don t consider or - to be integers. The last fundamental class of numbers we'll deal with are the real numbers. These are all the numbers that exist on the number line: 0, 1, ½, π, -3, -137 / 42, -e 2, etc. Every integer is a real number, but not the other way around. Continuing our trend from before, we don t consider or - real numbers. In the first week of class we'll also introduce a class of numbers called the rational numbers. These are numbers that can be written as one integer divided by another (the ratio of two numbers, which is where we get the term rational from.) All the integers are rational; as an example, the number 137 can be written as 137 / 1, and the number -4 can be written as -4 / 1. There are many rational numbers that aren't integers, such as 3 / 2, -7 / 4, and 335 / 113. As you'll see on Friday, there are also many real numbers that aren't rational, though proving this takes a bit of creativity. You may have encountered complex numbers in your high school math classes, but we won't be talking about them this quarter. That doesn't mean that they're not useful in computer science, though. Surprisingly, they have some neat applications in computer graphics! Skill 6: Using Closure Properties There's a very good chance that you know what a closure property is even if you have never heard the name before. Consider this section a way of learning new fancy terms you can throw around at cocktail parties, as in, I study closure properties of the natural numbers. By the time you're done with CS103, you'll have seen a bunch more of these in more advanced contexts, so you can sound even cooler: I study closure properties of the regular languages, such as closure under Kleene star. Yeah. You'll actually know that that means. Let's imagine you add two natural numbers together, like 4 + 5, 9 + 13, or 0 + 137. Regardless of what two natural numbers you add together, you're guaranteed that you'll get back a natural number as a result. The mathematical term for this is to say that the natural numbers are closed under addition. In other words, if you start with two natural numbers and add them together, you're guaranteed to get back a natural number. However, if you subtract two natural numbers, you are not guaranteed to get back a natural number. Sometimes you will (5 3 = 2, and 137 137 = 0), but sometimes you won't (3 5 = -2, and -2 is not a natural number because it's negative). Since the difference of two natural numbers is not guaranteed to also be a natural number, the natural numbers are not closed under subtraction.

5 / 6 What about multiplication and division? Well, if you multiply two natural numbers (6 5, 3 19, 137 1, 0 5, etc.), you're guaranteed to get back a natural number. That means that the natural numbers are closed under multiplication. However, dividing two natural numbers doesn't guarantee that you get back a natural number. Sometimes you do ( 6 / 3 = 2), but sometimes you don't ( 137 / 42 isn't a natural number), so we say that the natural numbers are not closed under division. To recap: The natural numbers are closed under addition and multiplication. The natural numbers are not closed under subtraction or division. What about the integers? Like the natural numbers, they're closed under addition and multiplication: adding or multiplying two integers always gives you back an integer. Like the natural numbers, they're not closed under division ( 137 / 42 is not an integer). However, unlike the natural numbers, the integers are closed under subtraction: the difference of any two integers is an integer. (Fun fact: mathematicians often define the integers as what you get when you start with the natural numbers and do the least awful thing to them that makes them closed under subtraction. I mean, it's more rigorous than that, but that's the basic idea.) What about the real numbers? They're closed under all four of the basic arithmetic operations: the sum, product, quotient, and difference of any two real numbers is also a real number. (We're assuming that you aren't dividing by zero, which just isn't possible. Trust us. We tried it, and it didn't work.) Here's a quick table recapping these facts: + Natural Numbers Yes No Yes No Integers Yes Yes Yes No Real Numbers Yes Yes Yes Yes The closure properties of the natural numbers, integers, and real numbers are usually considered so fundamental that they're not really talked about in proofs even though they often play a major role in them. If you look closely at the proofs from Wednesday and Friday's lectures, you'll see that these closure properties are referenced implicitly. Something that might be good to think about once we introduce them on Friday what are the rational numbers closed under?

6 / 6 Skill 7: Manipulating Inequalities Mathematical inequalities come up all the time in computer science. We use them to precisely say things like this algorithm will take at most n 2 time steps to complete or you'll need at least 2 n bits of memory to solve this problem exactly. If you continue onward in computer science, you'll get a lot of practice manipulating inequalities. In CS103, we're not going to spend that much time working with inequalities, though there are a few places where they'll come up at the start of the quarter. There's one particular set of rules for inequalities that is sometimes covered in high-school algebra and sometimes skipped, and that's what happens when you work with inequalities involving integers. For example, consider the inequality 2 < x < 3. This says that x is strictly greater than 2 and strictly less than 3. If x is allowed to be a real number, then there are lots of values of x that satisfy this inequality, such as 2.5, 2.1, or 2.71828. However, if x is an integer or a natural number, then there are no choices of x that make this true, since there aren't any integers between 2 and 3. It's worth looking into this in a little bit more detail. Let's imagine that n is a natural number. Then the inequality is exactly the same as the inequality 2 < n 3 n. Why is that? Well, since 2 is strictly less than n, then n can't be two or less, so it has to be three or more. More generally, let's imagine that m and n are integers or natural numbers. In that case, the inequality is exactly the same as the inequality m + 1 n. m < n This comes up every now and then in this course, so I figured I'd mention it here. Some Concluding Remarks I've taught CS103 to about 3,000 students and have never met anyone who was not appropriately mathematically prepared for the course. I've encountered many students who didn't feel confident with their understanding of mathematics or who were a bit out of practice with it, but I've never turned someone away from CS103 due to a lack of mathematical background. If anything, the students I've recommended not take CS103 usually have too strong of a math background! If you're concerned about whether or not you're prepared for CS103, I strongly recommend checking out our CS103A companion course, which meets for two hours a week and goes over extra practice problems with the material. It's a great way to practice, to meet students who you might end up working with on the problem sets, and to ask questions in a low-stress environment.