CSE 21 Mathematics for

Similar documents
Binomial Coefficients

Math 574 Review Exam #1

Discrete Structures. Fall Homework3

MTH-129 Review for Test 4 Luczak

An Introduction to Combinatorics and Graph Theory. David Guichard

An Introduction to Combinatorics and Graph Theory. David Guichard

Math 55 - Spring Lecture notes # 14 - March 9 (Tuesday)

Problem Set 7 Solutions

Counting. Chapter Basic Counting. The Sum Principle. We begin with an example that illustrates a fundamental principle.

Boolean Algebra. P1. The OR operation is closed for all x, y B x + y B

Bulgarian Math Olympiads with a Challenge Twist

Binomial Coefficient Identities and Encoding/Decoding

Practice Final Exam Solutions

CSE 312 Foundations II. 2. Counting. Winter 2017 W.L. Ruzzo

The transition: Each student passes half his store of candies to the right. students with an odd number of candies eat one.

Introduction to Higher Mathematics: Combinatorics and Graph Theory

Grade 7/8 Math Circles February 11/12, Counting I

Grade 7/8 Math Circles. Counting I

Section Sets and Set Operations

Summer Algebra Review

Section 1.8. Simplifying Expressions

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

Infinity and Uncountability. Countable Countably infinite. Enumeration

12. Predicate Logic Structures. The Lecture

A Combined BIT and TIMESTAMP Algorithm for. the List Update Problem. Susanne Albers, Bernhard von Stengel, Ralph Werchner

Generating Functions

Student Outcomes. Lesson Notes. Classwork. Discussion (4 minutes)

Catalan Numbers. Table 1: Balanced Parentheses

Midterm 2 Solutions. CS70 Discrete Mathematics for Computer Science, Fall 2007

HOMEWORK #4 SOLUTIONS - MATH 4160

Discrete Mathematics Exam File Fall Exam #1

MATHEMATICS 191, FALL 2004 MATHEMATICAL PROBABILITY Outline #1 (Countability and Uncountability)

An Introduction to Graph Theory

Lesson 14: Graph of a Linear Equation Horizontal and Vertical Lines

Lecture 25 : Counting DRAFT

2. There are 7 people to be seated at a round table. How many seating arrangements are possible? How many times must they change places so that

Notes for Recitation 13

Combinatorics Problems

= f (a, b) + (hf x + kf y ) (a,b) +

UCSD CSE 21 Winter 2017 Midterm 2 Practice Problems

8.NS.1 8.NS.2. 8.EE.7.a 8.EE.4 8.EE.5 8.EE.6

Zhibin Huang 07. Juni Zufällige Graphen

Trees and Intro to Counting

NO CALCULATOR ALLOWED

Basic Operations and Equivalent Expressions - Step-by-Step Lesson

16.50 RANDPOLY: A random polynomial generator

Encoding/Decoding. Russell Impagliazzo and Miles Jones Thanks to Janine Tiefenbruck. May 9, 2016

The Probabilistic Method

;; ;; Section 1 ;; ;; ;; What is the value of: (+ 2 (* 3 5)) ;; What is the value of: (string-append "Roberto" " " "Luongo")

Harvard-MIT Mathematics Tournament February 19, 2005

Winning Positions in Simplicial Nim

Introduction II. Sets. Terminology III. Definition. Definition. Definition. Example

Midterm 2. Friday, August 2, 5:10pm 7:10pm CS 70: Discrete Mathematics and Probability Theory, Summer 2013

Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103. Chapter 2. Sets

1 Linear programming relaxation

Summer Math Review. Algebra Packet. Dear Parents and Students,

ALGEBRA 1 B ANSWERS Semester Exam Review

HMMT February 2018 February 10, 2018

MATH 122 Final Exam Review Precalculus Mathematics for Calculus, 7 th ed., Stewart, et al. by hand.

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus)

2. (10 points) Consider the following algorithm performed on a sequence of numbers a 1, a 2,..., a n.

Basic Graph Theory with Applications to Economics

Math Summer 2012

Autumn Autumn 2 1. Spring 1 1

Math 230 Final Exam December 22, 2015

MATH ALGEBRA AND FUNCTIONS 5 Performance Objective Task Analysis Benchmarks/Assessment Students:

Solution : a) C(18, 1)C(325, 1) = 5850 b) C(18, 1) + C(325, 1) = 343

SET DEFINITION 1 elements members

Discrete mathematics , Fall Instructor: prof. János Pach

Combinatorics: The Fine Art of Counting

Number. Number. Number. Number

Unit 7 - Similarity 2. The perimeter of a rectangle is 156 cm. The ratio of the length to the width is 9:4. Find the width of the rectangle.

SIMPLIFYING Judo Math Inc.

Dynamic Programming Homework Problems

9 abcd = dcba b + 90c = c + 10b b = 10c.

Assignment 1 (concept): Solutions

Practical 4 Programming in R

Basic Properties The Definition of Catalan Numbers

Linear Equations - Word Problems

Student s booklet. Bills, Ladders and other Number Diagrams. Meeting 23 Student s Booklet. Contents. May 18, UCI. Town Bills 2 Big and Small

More About Factoring Trinomials

An Interesting Way to Combine Numbers

Formatting for TLM - Part I

Loki s Practice Sets for PUBP555: Math Camp Spring 2014

Computer Science and Mathematics. Part I: Fundamental Mathematical Concepts Winfried Kurth

Chapter 8 SETS AND DICTIONARIES

Civil Engineering Systems Analysis Lecture XIV. Instructor: Prof. Naveen Eluru Department of Civil Engineering and Applied Mechanics

Extra Practice Problems 2

2017 Four-by-Four Competition Thursday, February 2nd, Round Four-by-Four Competition Thursday, February 2nd, 2017.

DISCRETE MATHEMATICS THROUGH GUIDED DISCOVERY: Classnotes for MTH 355

NMC Sample Problems: Grade 8

MATHia X: Grade 8 Table of Contents

Week 12: Trees; Review. 22 and 24 November, 2017

Math 6 Midterm Review Solutions

4 Generating functions in two variables

A fraction (from Latin: fractus, "broken") represents a part of a whole.

MAT 003 Brian Killough s Instructor Notes Saint Leo University

Best Student Exam (Open and Closed) Solutions Texas A&M High School Math Contest 8 November 2014

Permutations and Combinations Learning Outcomes

Transcription:

CSE 21 Mathematics for Algorithm and System Analysis Summer, 2005 Day 2 Basic Enumeration and Counting Arrangements How many arrangements of the letters l, a, j, o, l, l, a? We have 3 l s to place Choose 3 places from 7 total We have 2 a s to place Choose 2 places from 4 remaining We have one j to place Choose 1 place from 2 remaining We have one o to place Choose 1 place from 1 remaining C(7, 3) C(4, 2) C(2, 1) C(1, 1) Instructor: Neil Rhodes 2 Arrangements (multinomial coefficients) If there are n objects with r1 of type 1, r2 of type 2,..., rm of type m, where r1+r2+...+rm n, then the number of arrangements of these n objects is: ( ) n P(n;r 1,r 2,...,r m ) r 1,r 2,...,r m ( )( )( ) ( ) n n r1 n r1 r 2 n r1 r 2... r m 1... r 1 r 2 r 3 r m Arrangements How many ways to select six ice cream cones from three flavors of ice cream? If the three flavors of ice cream are vanilla (V), chocolate (C), and Strawberry (S), then we can look at an order as # V followed by # C followed by #S. Imagine writing down the order in three columns: V C S XX XXX X How many way to create an arrangement of six X s, and two s? P(8;6,2) 8/(62) 28 n r 1 r 2...r m 3 4

Selection with repetition The number of selections with repetition of r objects from n types is C(r+n-1, r) Number of ways to create an arrangement of r X s and n s is: P(r+n-1;r,n-1) (r+n-1)/(r(n-1)) C(r+n-1,r) Equivalent to the number of ways to distribute r identical objects into n distinct boxes Equivalent to the number of non-negative integer solutions to x1+x2+...+xn r Arrangements How many ways to select nine ice cream cones from three flavors of ice cream if we have to have at least one of each variety? Get one of each flavor Now, select six ice cream cones from three different flavors If the three types of ice cream are vanilla (V), chocolate (C), and Strawberry (S), then we can look at an order as # V followed by # C followed by #S. Imagine writing down the order in three columns: - V C S XX XXX X How many way to create an arrangement of six X s, and two s? P(8;6,2) 8/(62) 28 5 6 Example (from 5.3 example 3) Nine students (three from class A, three from class B and three from class C) bought a block of nine seats for homecoming game. What is the probability that the three A students, three B students and three C students will each be seated consecutively? Example (from 5.3 example 4) DNA string consists of A, C, G, T. Suppose a C-enzyme (breaks up DNA after each appearance of C) breaks a 20-letter DNA string into 8 fragments: AC, AC, AAATC, C, C, C, TATA, TGGC (all fragments except last must end in C). How many different strings could have caused these fragments? 7 8

Example (from 5.3 example 5) How many ways are there to form a sequence of 10 letters from 4 as, 4 bs, 4 cs, and 4 ds if each letter must appear at least twice? Example (from 5.3 example 6) How many ways are there to fill a box of a dozen doughnuts chosen from 5 varieties if there must be at least one doughnut of each variety. If there must be at least two of each variety? 9 10 Example (from 5.3 example 7) How many ways to pick a collection of exactly 10 balls from a pile of red balls, blue balls, and purple balls if there must be at least 5 red balls? Example (from 5.3 Example 8) How many arrangements of b, a, n, a, n, a such that: The b is immediately followed by an a? The pattern bnn nevery occurs. If at most 5 red balls? The b occurs before any of the as 11 12

Example (from 5.3 exercise 22) How many ways are there first to pick a subset of r people from 50 people (each of a different height) and next to pick a second subset of s people such that everyone in the first subset is shorter than everyone in the second subset? Distributions Distributions of distinct objects Same as arrangements Distributing r distinct objects into n different boxes: Put the r objects into a row Stamp out n box names on each object Distributions of identical objects Same as selections Distributing r identical objects into n different boxes Choose a subset of r box names with repetition from n boxes C(r+n-1, r) distributions 13 14 Example (from 5.4 example 1) How many ways are there to assign 100 different diplomats to five different countries? Example You re playing a card game and your two opponents have 4 spades between them. Which is more likely: that they re split 3-1, or 2-2? If 20 diplomats must be assigned to each country? 15 16

Example (from 5.4 Example 2) In a game of bridge (N, S, E, W each dealt 13 cards). What is the probability that West has all 13 Spades? Example (from 5.4 example 4) How many ways to distribute four identical oranges and six distinct apples into five distinct boxes? What is the probability that each hand has one Ace? In what fraction of these distributions does each box get exactly two objects? 17 18 Example (from 5.4 example 5) Show the number of ways to distribute r identical balls into n distinct boxes with at least one ball in each box is C(r-1, n-1). Example 6 (from 5.4 example 6) How many integer solutions are there to the equation x1+x2+x3+x412 (xi 0)? With at least r1 balls in the first box,..., rn balls in the nth box, the number is C(r-r1-r2-...-rn+n-1,n-1) With x12, x22, x34, x40? 19 20

Example (similar to 5.4 example 8) A bitonic sequence is a sequence of 1s followed by 0s followed by 1s, or a sequence of 0s followed by 1s followed by 0s. 010, 011110, 10 are bitonic sequences. How many bitonic sequences of length 9 are there? Example (from 5.4 Exercise 20) What fraction of all arrangements of EFFLORESCENCE has consecutive Cs and consecutive Fs but no consecutive Es? 21 22 All of These are Equivalent 1. The number of ways to select r objects with repetition from n different types of objects Summary Arrange/Select/Distribute r objects from n items 2. The number of ways to distribute r identical objects into n distinct boxes Arrangement (ordered outcome) or Distribution of distinct objects Combination (unordered outcome) or Distribution of identical objects 3. The number of nonnegative integer solutions to: x1 + x2 + + xn r. No repetition Unlimited repetition Restricted repetition 23 24

Binomial Theorem Let s look at (x+y) n (x+y) 3 xxx + xxy + xyx + xyy + yxx + yxy + yyx + yyy x 3 + 3x 2 y + 3xy 2 + y 3 Binomial Theorem Let s look at (x+y) n What is the coefficient of x k y n-k in (x+y) n? ( n k) How many terms of the form x k y 3-k in (x+y) 3? How many ways to choose k xs and (3-k) ys from 3 total? C(3, k) Binomial Theorem: (x + y) n x n + 0 x n 1 y 1 + 1 x n 2 y 2 +... + 2 x n k y k +... k n y n 25 26 Binomial Identities Pascal s Triangle Symmetry Identity Number of paths equals C(n, k) Fundamental Identity ( ) ( ) n n n k k(n k) n k ( ) ( n n 1 k k Algebraic Proof ) + 1 k 1 Proof by Pascal s triangle Proof by combinatorial argument 27 28