Counting Product Rule

Size: px
Start display at page:

Download "Counting Product Rule"

Transcription

1 Counting Product Rule Suppose a procedure can be broken down into a sequence of two tasks. If there are n 1 ways to do the first task and n 2 ways to do the second task, then there are n 1 * n 2 ways to do the procedure A x B = A B If A and B are finite sets, the number of elements in the Cartesian product of the sets is product of the # elements in each set Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

2 The Product Rule Example: How many different license plates can be made if each plate contains a sequence of three uppercase English letters followed by three digits? Solution: By the product rule, there are = 17,576,000 different possible license plates. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

3 Counting Suppose you have 4 shirts, 3 pairs of pants, and 2 pairs of shoes. How many different outfits do you have? Product Rule Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

4 Product Rule How many functions are there from set A to set B? A B 64 To define each function we have to make 3 choices, one for each element of A How many ways can each choice be made? Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

5 Product Rule How many one-to-one functions are there from set A to set B? A B 24 To define each function we have to make 3 choices, one for each element of A How many ways can each choice be made? Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

6 Counting Sum Rule If a task can be done either in one of n 1 ways or in one of n 2 ways, where none of the n 1 ways is the same as any of the set of n 2 ways, then there are n 1 + n 2 ways to do the task If A and B are disjoint sets then A U B = A + B Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

7 Counting Suppose a student can choose a computer project from one of three lists List A 23 projects List B 15 projects List C 19 projects No project is on more than one list How many possible projects are there to choose from? Sum Rule Just count them up = 57 Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

8 Decision Tree (Tree Diagrams) Suppose you have 4 shirts, 3 pairs of pants, and 2 pairs of shoes. How many different outfits do you have? Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

9 Decision Tree How many different best of 5 game series were possible between the Cubs and the Dogers? 20 A DT is a good model for a sequence of events. It assists in counting, and can help you see special structure in the problem. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

10 DNA and Genomes A gene is a segment of a DNA molecule that encodes a particular protein and the entirety of genetic information of an organism is called its genome. DNA molecules consist of two strands of blocks known as nucleotides. Each nucleotide is composed of bases: adenine (A), cytosine (C), guanine (G), or thymine (T). The DNA of bacteria has between 10 5 and 10 7 links (one of the four bases). Mammals have between 10 8 and links. So, by the product rule there are at least different sequences of bases in the DNA of bacteria and different sequences of bases in the DNA of mammals. The human genome includes approximately 23,000 genes, each with 1,000 or more links. Biologists, mathematicians, and computer scientists all work on determining the DNA sequence (genome) of different organisms. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

11 Telephone Numbering Plan Example: The North American numbering plan (NANP) specifies that a telephone number consists of 10 digits, consisting of a three-digit area code, a three-digit office code, and a four-digit station code. There are some restrictions on the digits. Let X denote a digit from 0 through 9. Let N denote a digit from 2 through 9. Let Y denote a digit that is 0 or 1. In the old plan (in use in the 1960s) the format was NYX-NNX-XXX. In the new plan, the format is NXX-NXX-XXXX. How many different telephone numbers are possible under the old plan and the new plan? Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

12 Telephone Numbering Plan Example: The North American numbering plan (NANP) specifies that a telephone number consists of 10 digits, consisting of a three-digit area code, a three-digit office code, and a four-digit station code. There are some restrictions on the digits. Let X denote a digit from 0 through 9. Let N denote a digit from 2 through 9. Let Y denote a digit that is 0 or 1. In the old plan (in use in the 1960s) the format was NYX-NNX-XXXX. In the new plan, the format is NXX-NXX-XXXX. How many different telephone numbers are possible under the old plan and the new plan? Solution: Use the Product Rule. There are = 160 area codes with the format NYX. There are = 800 area codes with the format NXX. There are = 640 office codes with the format NNX. There are = 10,000 station codes with the format XXXX. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

13 Telephone Numbering Plan Example: The North American numbering plan (NANP) specifies that a telephone number consists of 10 digits, consisting of a three-digit area code, a three-digit office code, and a four-digit station code. There are some restrictions on the digits. Let X denote a digit from 0 through 9. Let N denote a digit from 2 through 9. Let Y denote a digit that is 0 or 1. In the old plan (in use in the 1960s) the format was NYX-NNX-XXXX. In the new plan, the format is NXX-NXX-XXXX. How many different telephone numbers are possible under the old plan and the new plan? Solution: Use the Product Rule. There are = 160 area codes with the format NYX. There are = 800 area codes with the format NXX. There are = 640 office codes with the format NNX. There are = 10,000 station codes with the format XXXX. Number of old plan telephone numbers: ,000 = 1,024,000,000. Number of new plan telephone numbers: ,000 = 6,400,000,000. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

14 Inclusion Exclusion Principle If a task can be done either in one of n 1 ways or in one of n 2 ways, but some of the n 1 ways are the same as some of the n 2 ways. Are there n 1 + n 2 ways to do the task now? If sets A and B are NOT disjoint A U B = A + B - A n B Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

15 Example Count the number of bit strings of length 4 which begin with a 1 or end with 00 How many bit strings of length 4 begin with a 1? 2 3 = 8 How many bit strings end in 00? 2 2 = 4 So the total is = 12? How many bit strings end in 00 and start with 1? 2 The real total is = 10 Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

16 Combining the Sum and Product Rule Example: Suppose statement labels in a programming language can be either a single letter or a letter followed by a digit. Find the number of possible labels. Solution: Use the product rule = 286 Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

17 Counting Passwords Combining the sum and product rule allows us to solve more complex problems. Example: Each user on a computer system has a password, which is six to eight characters long, where each character is an uppercase letter or a digit. Each password must contain at least one digit. How many possible passwords are there? Solution: Let P be the total number of passwords, and let P 6, P 7, and P 8 be the passwords of length 6, 7, and 8. By the sum rule P = P 6 + P 7 +P 8. To find each of P 6, P 7, and P 8, we find the number of passwords of the specified length composed of letters and digits and subtract the number composed only of letters. We find that: P 6 = =2,176,782, ,915,776 =1,867,866,560. P 7 = = 78,364,164,096 8,031,810,176 = 70,332,353,920. P 8 = = 2,821,109,907, ,827,064,576 =2,612,282,842,880. Consequently, P = P 6 + P 7 +P 8 = 2,684,483,063,360. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

18 Internet Addresses Version 4 of the Internet Protocol (IPv4) uses 32 bits. Class A Addresses: used for the largest networks, a 0,followed by a 7- bit netid and a 24-bit hostid. Class B Addresses: used for the medium-sized networks, a 10,followed by a 14-bit netid and a 16-bit hostid. Class C Addresses: used for the smallest networks, a 110,followed by a 21-bit netid and a 8-bit hostid. Neither Class D nor Class E addresses are assigned as the address of a computer on the internet. Only Classes A, B, and C are available is not available as the netid of a Class A network. Hostids consisting of all 0s and all 1s are not available in any network. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

19 Counting Internet Addresses Example: How many different IPv4 addresses are available for computers on the internet? Solution: Use both the sum and the product rule. Let x be the number of available addresses, and let x A, x B, and x C denote the number of addresses for the respective classes. To find, x A : = 127 netids = 16,777,214 hostids. x A = ,777,214 = 2,130,706,178. To find, x B : 2 14 = 16,384 netids = 16,534 hostids. x B = 16,384 16, 534 = 1,073,709,056. To find, x C : 2 21 = 2,097,152 netids = 254 hostids. x C = 2,097, = 532,676,608. Hence, the total number of available IPv4 addresses is x = x A + x B + x C = 2,130,706, ,073,709, ,676,608 = 3, 737,091,842. Not Enough Today!! The newer IPv6 protocol solves the problem of too few addresses. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

20 Pigeonhole Principle If n pigeons fly into k pigeonholes and k < n, then some pigeonhole contains at least two pigeons. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

21 Pigeonhole Principle We can use this simple little fact to prove amazingly complex things. If n pigeons fly into k pigeonholes and k < n, then some pigeonhole contains at least two pigeons. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

22 The Pigeonhole Principle Pigeonhole Principle: If k is a positive integer and k + 1 objects are placed into k boxes, then at least one box contains two or more objects. Proof: We use a proof by contraposition. Suppose none of the k boxes has more than one object. Then the total number of objects would be at most k. This contradicts the statement that we have k + 1 objects. Corollary 1: A function f from a set with k + 1 elements to a set with k elements is not one-to-one. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

23 Pigeonhole Principle Example: Among any group of 367 people, there must be at least two with the same birthday, because there are only 366 possible birthdays. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

24 The Generalized Pigeonhole Principle The Generalized Pigeonhole Principle: If N objects are placed into k boxes, then there is at least one box containing at least N/k objects. Proof: We use a proof by contraposition. Suppose that none of the boxes contains more than N/k 1 objects. Then the total number of objects is at most where the inequality N/k < N/k + 1 has been used. This is a contradiction because there are a total of n objects. Example: Among 100 people there are at least 100/12 = 9 who were born in the same month. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

25 Pigeonhole Principle Let S contain any 6 positive integers. Then, there is a pair of numbers in S whose difference is divisible by 5. Let S = {a 1,a 2,a 3,a 4,a 5,a 6 }. Each of these has a remainder when divided by 5. What can these remainders be? 6 numbers, 5 possible remainders what do we know? 0, 1, 2, 3, or 4 Some pair has the same remainder, by PHP Consider that pair, a i and a j, and their remainder r. a i = 5m + r, and a j = 5n + r. Their difference: a i - a j = (5m + r) - (5n + r) = 5m - 5n = 5(m-n), which is divisible by 5. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

26 Pigeonhole Principle Six people go to a party. Either there is a group of 3 who all know each other, or there is a group of 3 who are all strangers. Consider one person. She either knows or doesn t know each other person. But there are 5 other people! So, she knows, or doesn t know, at least 3 others. Let s say she knows 3 others. If any of those 3 know each other, we have a blue ê, which means 3 people know each other. If not, then those 3 people must be strangers. But then we ve proven our conjecture for this case. The case where she doesn t know 3 others is similar. Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

27 Extra Examples In questions below suppose that a word is any string of seven letters of the alphabet, with repeated letters allowed. 1) How many words are there? 2) How many words end with the letter T? 3) How many words begin with R and end with T? 4) How many words begin with A or B? 5) How many words begin with A or end with B? 6) How many words begin with A or B and end with A or B? Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

28 Extra Examples Solutions In questions below suppose that a word is any string of seven letters of the alphabet, with repeated letters allowed. 1) How many words are there? ) How many words end with the letter T? ) How many words begin with R and end with T? ) How many words begin with A or B? 2 * ) How many words begin with A or end with B? ) How many words begin with A or B and end with A or B? 4 * 26 5 Extensible Networking Platform CSE 240 Logic and Discrete Mathematics

Basic Counting Principles: The Product Rule

Basic Counting Principles: The Product Rule Section 6.1 Basic Counting Principles: The Product Rule The Product Rule: A procedure can be broken down into a sequence of two tasks. There are n 1 ways to do the first task and n 2 ways to do the second

More information

Math 3336 Section 6.1 The Basics of Counting The Product Rule The Sum Rule The Subtraction Rule The Division Rule

Math 3336 Section 6.1 The Basics of Counting The Product Rule The Sum Rule The Subtraction Rule The Division Rule Math 3336 Section 6.1 The Basics of Counting The Product Rule The Sum Rule The Subtraction Rule The Division Rule Examples, Examples, and Examples Tree Diagrams Basic Counting Principles: The Product Rule

More information

Counting: Basics. Rosen, Chapter 6.1

Counting: Basics. Rosen, Chapter 6.1 Counting: Basics Rosen, Chapter 6.1 A simple counting problem n You have 6 pairs of pants and 10 shirts. How many different outfits does this give? n Possible answers: A) 6 x 10 B) 6 + 10 Counting: the

More information

Counting: Basics. A simple counting problem. Counting: the product rule. Relation to Cartesian products. Relation to Cartesian products

Counting: Basics. A simple counting problem. Counting: the product rule. Relation to Cartesian products. Relation to Cartesian products A simple counting problem Counting: Basics Possible answers: 6 x 10 6 + 10 Rosen, Chapter 6.1 Counting: the product rule If there are n1 ways of doing one task, and for each of those there are n2 ways

More information

CS228 - Basic Counting and the Pigeonhole Principle

CS228 - Basic Counting and the Pigeonhole Principle CS228 - Basic Counting and the Pigeonhole Principle Nathan Sprague February 19, 2014 Material in these slides is from Discrete Mathematics and Its Applications 7e, Kenneth Rosen, 2012. The Product Rule

More information

Counting. Rosen, Chapter 6 Walls and Mirrors, Chapter 3

Counting. Rosen, Chapter 6 Walls and Mirrors, Chapter 3 Counting Rosen, Chapter 6 Walls and Mirrors, Chapter 3 Spock's dilemma (Walls and mirrors) n planets in the solar system can only visit k

More information

Introduction. CS243: Discrete Structures. Combinatorics. Product Rule. Basic Counting Rules. Example 2. Example 1

Introduction. CS243: Discrete Structures. Combinatorics. Product Rule. Basic Counting Rules. Example 2. Example 1 Introduction CS243: Discrete Structures Combinatorics Işıl Dillig Consider a set of objects and a property of interest Often, we want to know how many of these objects have the desired property Example:

More information

Counting. Andreas Klappenecker

Counting. Andreas Klappenecker Counting Andreas Klappenecker Counting k = 0; for(int i=1; i

More information

Discrete Structures Lecture The Basics of Counting

Discrete Structures Lecture The Basics of Counting Introduction Good morning. Combinatorics is the study of arrangements of objects. Perhaps, the first application of the study of combinatorics was in the study of gambling games. Understanding combinatorics

More information

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

Solution : a) C(18, 1)C(325, 1) = 5850 b) C(18, 1) + C(325, 1) = 343 DISCRETE MATHEMATICS HOMEWORK 5 SOL Undergraduate Course College of Computer Science Zhejiang University Fall-Winter 2014 HOMEWORK 5 P344 1. There are 18 mathematics majors and 325 computer science majors

More information

Counting Pigeonhole principle

Counting Pigeonhole principle CS 44 Discrete Mathematics for CS Lecture 23 Counting Pigeonhole principle Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Course administration Homework 7 is due today Homework 8 is out due on

More information

Discrete Structures for Computer Science

Discrete Structures for Computer Science Discrete Structures for Computer Science William Garrison bill@cs.pitt.edu 6311 Sennott Square Lecture #19: Counting Basics Based on materials developed by Dr. Adam Lee Today s Topics n Introduction to

More information

It is important that you show your work. There are 134 points available on this test.

It is important that you show your work. There are 134 points available on this test. Math 1165 Discrete Math Test April 4, 001 Your name It is important that you show your work There are 134 points available on this test 1 (10 points) Show how to tile the punctured chess boards below with

More information

Solutions to In Class Problems Week 9, Fri.

Solutions to In Class Problems Week 9, Fri. Massachusetts Institute of Technology 6.042J/18.062J, Fall 05: Mathematics for Computer Science November 4 Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld revised November 4, 2005, 1254 minutes Solutions

More information

ELEC-270 Solutions to Assignment 5

ELEC-270 Solutions to Assignment 5 ELEC-270 Solutions to Assignment 5 1. How many positive integers less than 1000 (a) are divisible by 7? (b) are divisible by 7 but not by 11? (c) are divisible by both 7 and 11? (d) are divisible by 7

More information

1 Algorithm and Proof for Minimum Vertex Coloring

1 Algorithm and Proof for Minimum Vertex Coloring Solutions to Homework 7, CS 173A (Fall 2018) Homework 7 asked you to show that the construction problems Maximum Independent Set, Minimum Vertex Coloring, and Maximum Clique could all be solved in polynomial

More information

Computer Science 236 Fall Nov. 11, 2010

Computer Science 236 Fall Nov. 11, 2010 Computer Science 26 Fall Nov 11, 2010 St George Campus University of Toronto Assignment Due Date: 2nd December, 2010 1 (10 marks) Assume that you are given a file of arbitrary length that contains student

More information

6.00 Introduction to Computer Science and Programming Fall 2008

6.00 Introduction to Computer Science and Programming Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 6.00 Introduction to Computer Science and Programming Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.

More information

of Nebraska - Lincoln

of Nebraska - Lincoln University of Nebraska - Lincoln DigitalCommons@University of Nebraska - Lincoln MAT Exam Expository Papers Math in the Middle Institute Partnership 7-2008 De Bruijn Cycles Val Adams University of Nebraska

More information

COUNTING AND PROBABILITY

COUNTING AND PROBABILITY CHAPTER 9 COUNTING AND PROBABILITY Copyright Cengage Learning. All rights reserved. SECTION 9.3 Counting Elements of Disjoint Sets: The Addition Rule Copyright Cengage Learning. All rights reserved. Counting

More information

ASSIGNMENT 4. COMP-202, Summer 2017, All Sections. Due: Friday, June 16 th, 11:59pm

ASSIGNMENT 4. COMP-202, Summer 2017, All Sections. Due: Friday, June 16 th, 11:59pm ASSIGNMENT 4 COMP-202, Summer 2017, All Sections Due: Friday, June 16 th, 11:59pm Please read the entire PDF before starting. You must do this assignment individually. Question 1: 100 points 100 points

More information

Notes for Recitation 13

Notes for Recitation 13 6.04/18.06J Mathematics for Computer Science March 30, 005 Srini Devadas and Eric Lehman Notes for Recitation 13 Basic Counting Notions A bijection or bijective function is a function f : X Y such that

More information

Midterm 2 Solutions. CS70 Discrete Mathematics and Probability Theory, Spring 2009

Midterm 2 Solutions. CS70 Discrete Mathematics and Probability Theory, Spring 2009 CS70 Discrete Mathematics and Probability Theory, Spring 2009 Midterm 2 Solutions Note: These solutions are not necessarily model answers. Rather, they are designed to be tutorial in nature, and sometimes

More information

Discrete Structures. Fall Homework3

Discrete Structures. Fall Homework3 Discrete Structures Fall 2015 Homework3 Chapter 5 1. Section 5.1 page 329 Problems: 3,5,7,9,11,15 3. Let P(n) be the statement that 1 2 + 2 2 + +n 2 = n(n + 1)(2n + 1)/6 for the positive integer n. a)

More information

Unit 7 Number System and Bases. 7.1 Number System. 7.2 Binary Numbers. 7.3 Adding and Subtracting Binary Numbers. 7.4 Multiplying Binary Numbers

Unit 7 Number System and Bases. 7.1 Number System. 7.2 Binary Numbers. 7.3 Adding and Subtracting Binary Numbers. 7.4 Multiplying Binary Numbers Contents STRAND B: Number Theory Unit 7 Number System and Bases Student Text Contents Section 7. Number System 7.2 Binary Numbers 7.3 Adding and Subtracting Binary Numbers 7.4 Multiplying Binary Numbers

More information

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2

2.2 Set Operations. Introduction DEFINITION 1. EXAMPLE 1 The union of the sets {1, 3, 5} and {1, 2, 3} is the set {1, 2, 3, 5}; that is, EXAMPLE 2 2.2 Set Operations 127 2.2 Set Operations Introduction Two, or more, sets can be combined in many different ways. For instance, starting with the set of mathematics majors at your school and the set of

More information

Review of Number Systems

Review of Number Systems Review of Number Systems The study of number systems is important from the viewpoint of understanding how data are represented before they can be processed by any digital system including a digital computer.

More information

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x!

1. Relations 2. Equivalence relations 3. Modular arithmetics. ! Think of relations as directed graphs! xry means there in an edge x! 2 Today s Topics: CSE 20: Discrete Mathematics for Computer Science Prof. Miles Jones 1. Relations 2. 3. Modular arithmetics 3 4 Relations are graphs! Think of relations as directed graphs! xry means there

More information

Section 6.3: Further Rules for Counting Sets

Section 6.3: Further Rules for Counting Sets Section 6.3: Further Rules for Counting Sets Often when we are considering the probability of an event, that event is itself a union of other events. For example, suppose there is a horse race with three

More information

CSCI FOUNDATIONS OF COMPUTER SCIENCE

CSCI FOUNDATIONS OF COMPUTER SCIENCE 1 CSCI- 2200 FOUNDATIONS OF COMPUTER SCIENCE Spring 2015 March 30, 2015 2 Announcements Homework 5 is due now. Homework 6 is due next Monday, April 6 at 10am in class. It will be posted on the web site

More information

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

Discrete mathematics , Fall Instructor: prof. János Pach Discrete mathematics 2016-2017, Fall Instructor: prof. János Pach - covered material - Lecture 1. Counting problems To read: [Lov]: 1.2. Sets, 1.3. Number of subsets, 1.5. Sequences, 1.6. Permutations,

More information

Discrete Mathematics Exam File Fall Exam #1

Discrete Mathematics Exam File Fall Exam #1 Discrete Mathematics Exam File Fall 2015 Exam #1 1.) Which of the following quantified predicate statements are true? Justify your answers. a.) n Z, k Z, n + k = 0 b.) n Z, k Z, n + k = 0 2.) Prove that

More information

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

Math 302 Introduction to Proofs via Number Theory. Robert Jewett (with small modifications by B. Ćurgus) Math 30 Introduction to Proofs via Number Theory Robert Jewett (with small modifications by B. Ćurgus) March 30, 009 Contents 1 The Integers 3 1.1 Axioms of Z...................................... 3 1.

More information

Exam 1 February 3, 2015

Exam 1 February 3, 2015 CSC 1300-003 Discrete Structures Exam 1 February 3, 2015 Name: KEY Question Value Score 1 20 2 20 3 20 4 20 5 20 OAL 100 Please answer questions in the spaces provided. If you make a mistake or for some

More information

CSE 20 DISCRETE MATH. Winter

CSE 20 DISCRETE MATH. Winter CSE 20 DISCRETE MATH Winter 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/ Final exam The final exam is Saturday March 18 8am-11am. Lecture A will take the exam in GH 242 Lecture B will take the exam

More information

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1 IT 1204 Section 2.0 Data Representation and Arithmetic 2009, University of Colombo School of Computing 1 What is Analog and Digital The interpretation of an analog signal would correspond to a signal whose

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

A graph is a mathematical structure for representing relationships.

A graph is a mathematical structure for representing relationships. Graphs Part Two A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph is a mathematical structure

More information

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value

Number System. Introduction. Natural Numbers (N) Whole Numbers (W) Integers (Z) Prime Numbers (P) Face Value. Place Value 1 Number System Introduction In this chapter, we will study about the number system and number line. We will also learn about the four fundamental operations on whole numbers and their properties. Natural

More information

Data Analytics. Qualification Exam, May 18, am 12noon

Data Analytics. Qualification Exam, May 18, am 12noon CS220 Data Analytics Number assigned to you: Qualification Exam, May 18, 2014 9am 12noon Note: DO NOT write any information related to your name or KAUST student ID. 1. There should be 12 pages including

More information

Section 1.4 Proving Conjectures: Deductive Reasoning

Section 1.4 Proving Conjectures: Deductive Reasoning Section 1.4 Proving Conjectures: Deductive Reasoning May 9 10:15 AM 1 Definition: Proof: A mathematical argument showing that a statement is valid in all cases, or that no counterexample exists. Generalization:

More information

a- As a special case, if there is only one symbol, no bits are required to specify it.

a- As a special case, if there is only one symbol, no bits are required to specify it. Codes A single bit is useful if exactly two answers to a question are possible. Examples include the result of a coin toss (heads or tails), Most situations in life are more complicated. This chapter concerns

More information

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Decision Problems Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Definition: The class of problems that can be solved by polynomial-time

More information

1998 Northeast North America Programming Contest. Problem Number 1: The Return of the Roman Empire

1998 Northeast North America Programming Contest. Problem Number 1: The Return of the Roman Empire 1998 Northeast North America Programming Contest Problem Number 1: The Return of the Roman Empire Write a program that accepts a Roman numeral and converts it to decimal form. Remember, I=1, V=5, X=10,

More information

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

Math 55 - Spring Lecture notes # 14 - March 9 (Tuesday) Math 55 - Spring 2004 - Lecture notes # 14 - March 9 (Tuesday) Read Chapter 4 Goals for Today: Continue counting principles Tree diagrams Pigeonhole principle Permutations Combinations Homework: 1) (Based

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/ SECTION 5.9 General Recursive Definitions and Structural Induction Copyright Cengage

More information

The 4/5 Upper Bound on the Game Total Domination Number

The 4/5 Upper Bound on the Game Total Domination Number The 4/ Upper Bound on the Game Total Domination Number Michael A. Henning a Sandi Klavžar b,c,d Douglas F. Rall e a Department of Mathematics, University of Johannesburg, South Africa mahenning@uj.ac.za

More information

Section 1.1. Inductive Reasoning. Copyright 2013, 2010, 2007, Pearson, Education, Inc.

Section 1.1. Inductive Reasoning. Copyright 2013, 2010, 2007, Pearson, Education, Inc. Section 1.1 Inductive Reasoning What You Will Learn Inductive and deductive reasoning processes 1.1-2 Natural Numbers The set of natural numbers is also called the set of counting numbers. N = {1, 2, 3,

More information

To illustrate what is intended the following are three write ups by students. Diagonalization

To illustrate what is intended the following are three write ups by students. Diagonalization General guidelines: You may work with other people, as long as you write up your solution in your own words and understand everything you turn in. Make sure to justify your answers they should be clear

More information

Order from Chaos. University of Nebraska-Lincoln Discrete Mathematics Seminar

Order from Chaos. University of Nebraska-Lincoln Discrete Mathematics Seminar Order from Chaos University of Nebraska-Lincoln Discrete Mathematics Seminar Austin Mohr Department of Mathematics Nebraska Wesleyan University February 8, 20 The (, )-Puzzle Start by drawing six dots

More information

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60

CPS 102: Discrete Mathematics. Quiz 3 Date: Wednesday November 30, Instructor: Bruce Maggs NAME: Prob # Score. Total 60 CPS 102: Discrete Mathematics Instructor: Bruce Maggs Quiz 3 Date: Wednesday November 30, 2011 NAME: Prob # Score Max Score 1 10 2 10 3 10 4 10 5 10 6 10 Total 60 1 Problem 1 [10 points] Find a minimum-cost

More information

AXIOMS FOR THE INTEGERS

AXIOMS FOR THE INTEGERS AXIOMS FOR THE INTEGERS BRIAN OSSERMAN We describe the set of axioms for the integers which we will use in the class. The axioms are almost the same as what is presented in Appendix A of the textbook,

More information

EULERIAN GRAPHS AND ITS APPLICATIONS

EULERIAN GRAPHS AND ITS APPLICATIONS EULERIAN GRAPHS AND ITS APPLICATIONS Aruna R 1, Madhu N.R 2 & Shashidhar S.N 3 1.2&3 Assistant Professor, Department of Mathematics. R.L.Jalappa Institute of Technology, Doddaballapur, B lore Rural Dist

More information

Indicate the option which most accurately completes the sentence.

Indicate the option which most accurately completes the sentence. Discrete Structures, CSCI 246, Fall 2015 Final, Dec. 10 Indicate the option which most accurately completes the sentence. 1. Say that Discrete(x) means that x is a discrete structures exam and Well(x)

More information

Prepared by Sa diyya Hendrickson. Package Summary

Prepared by Sa diyya Hendrickson. Package Summary Introduction Prepared by Sa diyya Hendrickson Name: Date: Package Summary Exponent Form and Basic Properties Order of Operations Using Divisibility Rules Finding Factors and Common Factors Primes, Prime

More information

Introduction to Sets and Logic (MATH 1190)

Introduction to Sets and Logic (MATH 1190) Introduction to Sets and Logic () Instructor: Email: shenlili@yorku.ca Department of Mathematics and Statistics York University Dec 4, 2014 Outline 1 2 3 4 Definition A relation R from a set A to a set

More information

Number Theory and Proof Methods

Number Theory and Proof Methods 9/6/17 Lecture Notes on Discrete Mathematics. Birzeit University Palestine 2016 and Proof Methods Mustafa Jarrar 4.1 Introduction 4.3 Divisibility 4.4 Quotient-Remainder Theorem mjarrar 2015 1 Watch this

More information

Number Theory and Graph Theory

Number Theory and Graph Theory 1 Number Theory and Graph Theory Chapter 6 Basic concepts and definitions of graph theory By A. Satyanarayana Reddy Department of Mathematics Shiv Nadar University Uttar Pradesh, India E-mail: satya8118@gmail.com

More information

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall CSE 20 https://goo.gl/forms/1o 1KOd17RMoURxjn2 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Explain the steps in a proof by mathematical and/or structural

More information

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics

[Ch 6] Set Theory. 1. Basic Concepts and Definitions. 400 lecture note #4. 1) Basics 400 lecture note #4 [Ch 6] Set Theory 1. Basic Concepts and Definitions 1) Basics Element: ; A is a set consisting of elements x which is in a/another set S such that P(x) is true. Empty set: notated {

More information

Propositional Logic. Application of Propositional logic

Propositional Logic. Application of Propositional logic DISCRETE STRUCTURE Propositional Logic Application of Propositional logic Propositional logic is the study of propositions (true or false statements) and ways of combining them (logical operators) to

More information

Table 1 below illustrates the construction for the case of 11 integers selected from 20.

Table 1 below illustrates the construction for the case of 11 integers selected from 20. Q: a) From the first 200 natural numbers 101 of them are arbitrarily chosen. Prove that among the numbers chosen there exists a pair such that one divides the other. b) Prove that if 100 numbers are chosen

More information

Graph Theory Part Two

Graph Theory Part Two Graph Theory Part Two Recap from Last Time A graph is a mathematical structure for representing relationships. Nodes A graph consists of a set of nodes (or vertices) connected by edges (or arcs) A graph

More information

15.4 Longest common subsequence

15.4 Longest common subsequence 15.4 Longest common subsequence Biological applications often need to compare the DNA of two (or more) different organisms A strand of DNA consists of a string of molecules called bases, where the possible

More information

Functions. Jason Filippou UMCP. Jason Filippou UMCP) Functions / 19

Functions. Jason Filippou UMCP. Jason Filippou UMCP) Functions / 19 Functions Jason Filippou CMSC250 @ UMCP 06-22-2016 Jason Filippou (CMSC250 @ UMCP) Functions 06-22-2016 1 / 19 Outline 1 Basic definitions and examples 2 Properties of functions 3 The pigeonhole principle

More information

World Inside a Computer is Binary

World Inside a Computer is Binary C Programming 1 Representation of int data World Inside a Computer is Binary C Programming 2 Decimal Number System Basic symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Radix-10 positional number system. The radix

More information

15.4 Longest common subsequence

15.4 Longest common subsequence 15.4 Longest common subsequence Biological applications often need to compare the DNA of two (or more) different organisms A strand of DNA consists of a string of molecules called bases, where the possible

More information

On the packing chromatic number of some lattices

On the packing chromatic number of some lattices On the packing chromatic number of some lattices Arthur S. Finbow Department of Mathematics and Computing Science Saint Mary s University Halifax, Canada BH C art.finbow@stmarys.ca Douglas F. Rall Department

More information

On vertex types of graphs

On vertex types of graphs On vertex types of graphs arxiv:1705.09540v1 [math.co] 26 May 2017 Pu Qiao, Xingzhi Zhan Department of Mathematics, East China Normal University, Shanghai 200241, China Abstract The vertices of a graph

More information

Nim-Regularity of Graphs

Nim-Regularity of Graphs Nim-Regularity of Graphs Nathan Reading School of Mathematics, University of Minnesota Minneapolis, MN 55455 reading@math.umn.edu Submitted: November 24, 1998; Accepted: January 22, 1999 Abstract. Ehrenborg

More information

Fall 2018 September 18, Written Homework 02

Fall 2018 September 18, Written Homework 02 S1800 Discrete Structures Profs. Gold, Pavlu, Rachlin & Sundaram Fall 2018 September 18, 2018 ssigned: Tue 18 Sep 2018 Due: Tue 25 Sep 2018 Instructions: Written Homework 02 The assignment has to be uploaded

More information

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. Functions functions 1 Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. a A! b B b is assigned to a a A! b B f ( a) = b Notation: If

More information

An Eternal Domination Problem in Grids

An Eternal Domination Problem in Grids Theory and Applications of Graphs Volume Issue 1 Article 2 2017 An Eternal Domination Problem in Grids William Klostermeyer University of North Florida, klostermeyer@hotmail.com Margaret-Ellen Messinger

More information

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH WINTER CSE 20 DISCRETE MATH WINTER 2016 http://cseweb.ucsd.edu/classes/wi16/cse20-ab/ Today's learning goals Explain the steps in a proof by (strong) mathematical induction Use (strong) mathematical induction

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/ SECTION 5.5 Application: Correctness of Algorithms Copyright Cengage Learning. All

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.2 Direct Proof and Counterexample II: Rational Numbers Copyright Cengage Learning. All

More information

CS 441 Discrete Mathematics for CS Lecture 24. Relations IV. CS 441 Discrete mathematics for CS. Equivalence relation

CS 441 Discrete Mathematics for CS Lecture 24. Relations IV. CS 441 Discrete mathematics for CS. Equivalence relation CS 441 Discrete Mathematics for CS Lecture 24 Relations IV Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Equivalence relation Definition: A relation R on a set A is called an equivalence relation

More information

CPSC 121 Midterm 2 Friday November 13th, 2015

CPSC 121 Midterm 2 Friday November 13th, 2015 CPSC 121 Midterm 2 Friday November 13th, 2015 [10] 1. For each of the following statements: Rewrite the statement using predicate logic. Write down ALL of the proof strategies (from the list given below),

More information

9.5 Equivalence Relations

9.5 Equivalence Relations 9.5 Equivalence Relations You know from your early study of fractions that each fraction has many equivalent forms. For example, 2, 2 4, 3 6, 2, 3 6, 5 30,... are all different ways to represent the same

More information

The strong chromatic number of a graph

The strong chromatic number of a graph The strong chromatic number of a graph Noga Alon Abstract It is shown that there is an absolute constant c with the following property: For any two graphs G 1 = (V, E 1 ) and G 2 = (V, E 2 ) on the same

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Copyright Cengage Learning. All rights reserved. SECTION 5.5 Application: Correctness of Algorithms Copyright Cengage Learning. All rights reserved.

More information

5 Graphs

5 Graphs 5 Graphs jacques@ucsd.edu Some of the putnam problems are to do with graphs. They do not assume more than a basic familiarity with the definitions and terminology of graph theory. 5.1 Basic definitions

More information

Line Graphs and Circulants

Line Graphs and Circulants Line Graphs and Circulants Jason Brown and Richard Hoshino Department of Mathematics and Statistics Dalhousie University Halifax, Nova Scotia, Canada B3H 3J5 Abstract The line graph of G, denoted L(G),

More information

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee

Sets. Mukulika Ghosh. Fall Based on slides by Dr. Hyunyoung Lee Sets Mukulika Ghosh Fall 2018 Based on slides by Dr. Hyunyoung Lee Sets Sets A set is an unordered collection of objects, called elements, without duplication. We write a A to denote that a is an element

More information

Connected Components of Underlying Graphs of Halving Lines

Connected Components of Underlying Graphs of Halving Lines arxiv:1304.5658v1 [math.co] 20 Apr 2013 Connected Components of Underlying Graphs of Halving Lines Tanya Khovanova MIT November 5, 2018 Abstract Dai Yang MIT In this paper we discuss the connected components

More information

Topology and the Four Color Theorem

Topology and the Four Color Theorem Topology and the Four Color Theorem Chelsey Poettker May 4, 2010 1 Introduction This project will use a combination of graph theory and topology to investigate graph coloring theorems. To color a graph

More information

Matchings in Graphs. Definition 1 Let G = (V, E) be a graph. M E is called as a matching of G if v V we have {e M : v is incident on e E} 1.

Matchings in Graphs. Definition 1 Let G = (V, E) be a graph. M E is called as a matching of G if v V we have {e M : v is incident on e E} 1. Lecturer: Scribe: Meena Mahajan Rajesh Chitnis Matchings in Graphs Meeting: 1 6th Jan 010 Most of the material in this lecture is taken from the book Fast Parallel Algorithms for Graph Matching Problems

More information

ON SWELL COLORED COMPLETE GRAPHS

ON SWELL COLORED COMPLETE GRAPHS Acta Math. Univ. Comenianae Vol. LXIII, (1994), pp. 303 308 303 ON SWELL COLORED COMPLETE GRAPHS C. WARD and S. SZABÓ Abstract. An edge-colored graph is said to be swell-colored if each triangle contains

More information

An Improved Upper Bound for the Sum-free Subset Constant

An Improved Upper Bound for the Sum-free Subset Constant 1 2 3 47 6 23 11 Journal of Integer Sequences, Vol. 13 (2010), Article 10.8.3 An Improved Upper Bound for the Sum-free Subset Constant Mark Lewko Department of Mathematics University of Texas at Austin

More information

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF

ELEMENTARY NUMBER THEORY AND METHODS OF PROOF CHAPTER 4 ELEMENTARY NUMBER THEORY AND METHODS OF PROOF Copyright Cengage Learning. All rights reserved. SECTION 4.6 Indirect Argument: Contradiction and Contraposition Copyright Cengage Learning. All

More information

Math 187 Sample Test II Questions

Math 187 Sample Test II Questions Math 187 Sample Test II Questions Dr. Holmes October 2, 2008 These are sample questions of kinds which might appear on Test II. There is no guarantee that all questions on the test will look like these!

More information

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL:

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 9 Notes. Class URL: Notes slides from before lecture CSE 21, Winter 2017, Section A00 Lecture 9 Notes Class URL: http://vlsicad.ucsd.edu/courses/cse21-w17/ Notes slides from before lecture Notes February 8 (1) HW4 is due

More information

Cantor s Diagonal Argument for Different Levels of Infinity

Cantor s Diagonal Argument for Different Levels of Infinity JANUARY 2015 1 Cantor s Diagonal Argument for Different Levels of Infinity Michael J. Neely University of Southern California http://www-bcf.usc.edu/ mjneely Abstract These notes develop the classic Cantor

More information

Lecture (02) Operations on numbering systems

Lecture (02) Operations on numbering systems Lecture (02) Operations on numbering systems By: Dr. Ahmed ElShafee ١ Dr. Ahmed ElShafee, ACU : Spring 2018, CSE202 Logic Design I Complements of a number Complements are used in digital computers to simplify

More information

SET DEFINITION 1 elements members

SET DEFINITION 1 elements members SETS SET DEFINITION 1 Unordered collection of objects, called elements or members of the set. Said to contain its elements. We write a A to denote that a is an element of the set A. The notation a A denotes

More information

International Journal of Computer Engineering and Applications, Volume XI, Issue XI, Nov. 17, ISSN

International Journal of Computer Engineering and Applications, Volume XI, Issue XI, Nov. 17,  ISSN International Journal of Computer Engineering and Applications, Volume XI, Issue XI, Nov. 17, www.ijcea.com ISSN 2321-3469 DNA PATTERN MATCHING - A COMPARATIVE STUDY OF THREE PATTERN MATCHING ALGORITHMS

More information

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

CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 CS103 Handout 13 Fall 2012 May 4, 2012 Problem Set 5 This fifth problem set explores the regular languages, their properties, and their limits. This will be your first foray into computability theory,

More information

Excerpt from "Art of Problem Solving Volume 1: the Basics" 2014 AoPS Inc.

Excerpt from Art of Problem Solving Volume 1: the Basics 2014 AoPS Inc. Chapter 5 Using the Integers In spite of their being a rather restricted class of numbers, the integers have a lot of interesting properties and uses. Math which involves the properties of integers is

More information

1 Elementary number theory

1 Elementary number theory Math 215 - Introduction to Advanced Mathematics Spring 2019 1 Elementary number theory We assume the existence of the natural numbers and the integers N = {1, 2, 3,...} Z = {..., 3, 2, 1, 0, 1, 2, 3,...},

More information

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4

CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University. Name: ID#: Section #: Score: / 4 CSE 215: Foundations of Computer Science Recitation Exercises Set #4 Stony Brook University Name: ID#: Section #: Score: / 4 Unit 7: Direct Proof Introduction 1. The statement below is true. Rewrite the

More information