Intro to Maths for CS: 2012/13 Sets (end, week 3) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,

Slides:



Advertisements
Similar presentations
(BY MISS.MANITA MODPHAI)
Advertisements

COUNTING AND PROBABILITY
Week 7 - Wednesday.  What did we talk about last time?  Set proofs and disproofs  Russell’s paradox.
1 Diagonalization Fact: Many books exist. Fact: Some books contain the titles of other books within them. Fact: Some books contain their own titles within.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 10 Cardinality Uncountability of the real numbers.
CHAPTER 4 Decidability Contents Decidable Languages
Pigeonhole.
A Very Practical Series 1 What if we also save a fixed amount (d) every year?
Cardinality of a Set “The number of elements in a set.” Let A be a set. a.If A =  (the empty set), then the cardinality of A is 0. b. If A has exactly.
“NUMBER NUTS” Intro to Math Mrs. Bonifay. REAL NUMBERS.
Convert Decimals to Fractions
Cardinality of Sets Section 2.5.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
THE NATURE OF SETS Copyright © Cengage Learning. All rights reserved. 2.
Intro to Maths for CS: 2013/14 Sets (2) – OPTIONAL MATERIAL John Barnden Professor of Artificial Intelligence School of Computer Science University of.
CS355 - Theory of Computation Lecture 2: Mathematical Preliminaries.
Copyright © Cengage Learning. All rights reserved. 0 Precalculus Review.
Real Numbers Week 1 Topic 1.
Relation, function 1 Mathematical logic Lesson 5 Relations, mappings, countable and uncountable sets.
Advanced Math Chapter P
Fundamentals/ICY: Databases 2010/11 WEEK 11 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
Chapter 6: The Real Numbers and Their Representations
Fundamentals/ICY: Databases 2012/13 WEEK 7 John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK.
2.4 Sequences and Summations
1 Lecture 3 (part 3) Functions – Cardinality Reading: Epp Chp 7.6.
P.1 Real Numbers. 2 What You Should Learn Represent and classify real numbers. Order real numbers and use inequalities. Find the absolute values of real.
Copyright © Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS.
Fundamentals/ICY: Databases 2012/13 WEEK 11 – 4 th Normal Form (optional material) John Barnden Professor of Artificial Intelligence School of Computer.
Ch. 11: Cantor’s Infinity!. N = {1, 2, 3, 4, 5, 6, …} “the natural numbers” Z = {…, –3, –2, –1, 0, 1, 2, 3, …} “the integers” Q = {all quotients “a/b”
Basic Structures: Sets, Functions, Sequences, and Sums CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Mathematical Induction
Copyright © 2014 Curt Hill Cardinality of Infinite Sets There be monsters here! At least serious weirdness!
Fundamentals/ICY: Databases 2013/14 WEEK 9 –Monday John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham,
11 DISCRETE STRUCTURES DISCRETE STRUCTURES UNIT 5 SSK3003 DR. ALI MAMAT 1.
College Algebra Sixth Edition James Stewart Lothar Redlin Saleem Watson.
COMPSCI 102 Introduction to Discrete Mathematics.
Aim: How can the word ‘infinite’ define a collection of elements?
Number System. Do not train children to learning by force and harshness, but direct them to it by what amuses their minds, so that you may be better able.
INFIINITE SETS CSC 172 SPRING 2002 LECTURE 23. Cardinality and Counting The cardinality of a set is the number of elements in the set Two sets are equipotent.
Unit 1-Number Sets Aa-1.1 Define and identify integers, rational, irrational, natural, whole and real numbers.
Introduction to Real Analysis Dr. Weihu Hong Clayton State University 8/27/2009.
Cardinality with Applications to Computability Lecture 33 Section 7.5 Wed, Apr 12, 2006.
I dare you not to get excited when you read Cantor’s Diagonal Proof: Georg Cantor was the most important mathematician no one has ever heard of. He did.
Great Theoretical Ideas in Computer Science.
Copyright © Cengage Learning. All rights reserved. Fundamental Concepts of Algebra 1.1 Real Numbers.
CompSci 102 Discrete Math for Computer Science February 7, 2012 Prof. Rodger Slides modified from Rosen.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Section 3.2: Sequences and Summations. Def: A sequence is a function from a subset of the set of integers (usually the set of natural numbers) to a set.
CS 285- Discrete Mathematics
Fundamentals/ICY: Databases 2013/14 Week 11 – Monday – relations, ended. John Barnden Professor of Artificial Intelligence School of Computer Science University.
Whole, Integers, Rational and Natural Numbers M7N1. Students will understand the meaning of positive and negative rational numbers and use them in computation.
Rational Number Lines Labeling Intro. 0 1 What happens when they are not whole numbers? Label 0.25 as point L #1.
Week 7 - Wednesday.  What did we talk about last time?  Proving the subset relationship  Proving set equality  Set counterexamples  Laws of set algebra.
Section 2.5. Cardinality Definition: A set that is either finite or has the same cardinality as the set of positive integers (Z + ) is called countable.
REAL NUMBERS (as opposed to fake numbers?) Why do we have to review numbers Miss Price? Be a beast in Math when you know the basics!
Making Sense of Rational and Irrational Numbers
The Acceptance Problem for TMs
Discrete Mathematics CS 2610
Intro to Maths for CS: 2012/13 Sets (contd, week 2)
Number Systems INTRODUCTION.
2.4 Sequences and Summations
Lesson 5 Relations, mappings, countable and uncountable sets
Module #4.5, Topic #∞: Cardinality & Infinite Sets
Discrete Mathematics and its Applications
Lesson 5 Relations, mappings, countable and uncountable sets
Module #4.5, Topic #∞: Cardinality & Infinite Sets
CS21 Decidability and Tractability
John Barnden Professor of Artificial Intelligence
Everything is an Integer Countable and Uncountable Sets
Presentation transcript:

Intro to Maths for CS: 2012/13 Sets (end, week 3) John Barnden Professor of Artificial Intelligence School of Computer Science University of Birmingham, UK

Reminder of Week 2

Functions uA total functional relation from A to B is called a function from A to B. Each thing in A is related to exactly one thing in B. (But two different things in A can be related to the same thing in B, and not everything in B needs to be related to anything in A. So the inverse relation is not necessarily either functional or total.) uCaution: every function is also a partial function.

Examples uA = {3, 8, 2, 100}, B = {‘jjj’, ‘bb’, ‘c’, ‘x’, ‘y’}. R = {,,,, } NOT a function, because 3 maps to more than one thing uR = {,, } NOT a function, because 8 fails to map to anything. uR = {,,, } IS a function.

From Partiality to Totality by Restriction uWe can always turn a merely-partial R from A to B into a total one by slimming A down enough! Just remove the members of A that aren’t related to anything by R, to get a new set AA. We don’t remove any tuples from R. uR (as a relation from AA to B) is total on AA. And note that R| AA = R. uAA is called the domain of R, notated dom(R).

Totality contd. and “Onto” uA relation R from A to B is onto if for everything in B there is at least one thing in A that is related by R to it. I.e.: l For every member b of B, there is at least one a in A such that  a, b> is in R. uOnto-ness is just totality in the other direction. You can also say that R is total on B, or that the inverse of R is total.

New for Week 3

Other Categories of Relation uA relation R from A to B is one-to-one (1-1) if, for any a in A, there is at most one b in B such that  a, b> is in R, AND for any b in B, there is at most one a in A such that  a, b> is in R. l That is, both the relation and its inverse from B to A are functional. (But they don’t need to be total.) l To put it another way: it is functional and different members of A map to (= are related to) different members of B. l Or again: Different members of A map to different members of B and different members of B map to different members of A.

Example uA = {3, 8, 2, 100}, B = {‘jjj’, ‘bb’, ‘c’, ‘x’, ‘y’}. R = {,, } IS 1-1

uA relation R from A to B is many-to-one if it is functional but not one-to-one: i.e., there are different members of A that map to the same member of B, in at least one case. uA relation R from A to B is one-to-many if it is not functional but its inverse from B to A is functional. That is, there’s a member of A that maps to more than one member of B; but each member of B maps to at most one member of A. uA relation R from A to B is many-to-many if neither it nor its inverse is functional: i.e., there’s a case of a member of A mapping to more than one member of B, and a case of a member of B mapping to more than one member of A. ((Other Categories of Relation, contd.))

Other categories, contd. uA one-to-one correspondence between a set A and B is a SPECIAL one-to-one relation from A to B (or B to A): u it is not only one-to-one but also TOTAL (on A) and ONTO (B). (Or we can say: total on both A and B.)

Example uA = {3, 8, 2, 100}, B = {‘jjj’, ‘bb’, ‘c’, ‘y’}. R = {,, } NOT a 1-1 correspondence between A and B, even though it is 1-1, as 2 is left out from A, and ‘bb’ is left out from B. uR = {,,, } IS a 1-1 correspondence between A and B

Other categories, contd. uBut any 1-1 relation from A to B is a 1-1 correspondence between the subsets of A, B consisting of those members that do happen to feature in the relation!

Countable and Uncountable Sets [Brief Intro; Optional Material] countable one-to-one correspondence uA set X is countable if it can be placed in a one-to-one correspondence with some subset of N, the set of natural numbers from 1. uTrivial case: X = N { | x  X}. Let R be the relation { | x  X}. This is the identity relation on X. Then R is a 1-1 correspondence between X and X.

Countable Sets, contd 1 uSimilarly for any proper subset X of N: just use the identity relation on X again. uMore interesting case: X = the set of all whole numbers (negative, positive and zero). Let R be the relation { | x  X, x  0}  { | x  X, x | x  X, x  0}  { | x  X, x < 0 } So R = {(0,0), (-1,1), (1,2), (-2,3), (2,4), (-3,5), (3,6), …} Then R is a 1-1 correspondence between X and N.

Countable Sets, contd 2 uYet more interesting case: X = the set of positive rational numbers. Can get our relation R by putting the possible fractions (with positive whole number parts) in a square infinite table with numerators increasing horizontally and denominators increasing vertically: 1/1 2/1 3/1 4/1 5/1 6/1 … 1/2 2/2 3/2 4/2 5/2 6/2 … 1/3 2/3 3/3 4/3 5/3 6/3 … 1/4 2/4 2/5 2/6 : : … : : : : : : … Then traverse through the numbers in sequence by going up and down diagonals, with steps on edges as necessary, and missing out fractions that are not in simplest form (missed out ones are shown in brackets): 1/1, 2/1, 1/2, 1/3, (2/2), 3/1, 4/1, 3/2, 2/3, 1/4, 1/5, (2,4), (3,3), (4,2), 5/1, … Count as:

Uncountable Sets uAll finite sets are countable. And they needn’t be sets of numbers! The set of socks in this class is countable. uWe have seen that some infinite ones are countable … uEven if the set X contains the natural numbers as a tiny proper subset!! E.g., X = the set of rational numbers. uBut some infinite sets are not countable: notably the set of real numbers (rational and irrational numbers together), or even the set of real numbers between 0 and 1. Can be shown by a an incredibly interesting and deep “diagonalization” argument based on the decimal representations of the numbers (see next slide)…

Uncountable Sets: The Real Numbers uConsider the set of real numbers strictly between 0 and 1, and represent them as decimals …  … in a canonical form – i.e. don’t allow them to end with 9 recurring (e.g., use not ….), and fill out terminating decimals with an ninfifnte sequence of zeroes at the and (so actually use …..) (D) uCan show that: (D) different numbers always then have different decimal representations. uNow, suppose you could enumerate the above real numbers in some order, i.e. put them into 1-1 correspondence with natural numbers, e.g. (next slide). We will derives a contradiction.

The Real Numbers, contd  Here’s how the enumeration might look:  No.1: …  No.2: ….  No.3: …..  No.4: …. uNow form a decimal number by where the nth digit is the nth digit of the nth decimal above: … uNow replace each digit in that decimal by a different digit other than 9 (doesn’t matter which), e.g. to get … (D) uThis decimal is therefore different from any in the enumeration above, because it always differs from the nth decimal in at least one digit, namely the nth. And therefore by (D) above it represents a real number between 0 and 1 not counted in the enumeration!!!!! We have our contradiction.

Diagonalization, contd  For deep reasons, diagonalization arguments crop up all over the place in maths and logic and especially in their application to CS.  A relatively general formulation is that when you have an function of two arguments, f(n,m), you can force both arguments to be the same, to get a new function g(n) = f(n,n). Function g is the diagonalization of f.  Why? – Just imagine setting out the values of f(n,m) in a square array. Then g(n)’s values will be on the diagonal.  In our case f(n,m) gives the nth digit of the mth decimal (in the supposed enumeration of decimals). So the values of g(n) for n=1 upwards give us a new decimal number which causes trouble.  Diagonalization is often used in other, completely different, contexts to create entities that cause trouble, typically by not being able to be accounted for in some way.