Download Lecture 12

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Location arithmetic wikipedia , lookup

Foundations of mathematics wikipedia , lookup

Law of large numbers wikipedia , lookup

Ethnomathematics wikipedia , lookup

Positional notation wikipedia , lookup

Infinitesimal wikipedia , lookup

Mathematics of radio engineering wikipedia , lookup

Bernoulli number wikipedia , lookup

Non-standard analysis wikipedia , lookup

Proofs of Fermat's little theorem wikipedia , lookup

Surreal number wikipedia , lookup

Georg Cantor's first set theory article wikipedia , lookup

Hyperreal number wikipedia , lookup

Large numbers wikipedia , lookup

Real number wikipedia , lookup

Infinity wikipedia , lookup

Elementary mathematics wikipedia , lookup

Addition wikipedia , lookup

Transcript
Sets, Finite and Infinite;!
Starting to Count"
CSCI 2824, Fall 2012"
"
!
Assignments
• To read this week: Sections 5.1-5.2
• Problem Set 2 has been sent out; the due date for PS 2
is Tuesday, October 16.
"
!
!
!!
Set theory: the basic stuff
•  What sets are
•  Operations on sets: Union, intersection, set
difference
•  More operations on sets: Cartesian product,
“Power set”
In extreme cases, sets require
care…
•  “The set of all sets S that do not contain
themselves”
The sizes of sets: a few warm-up
questions
•  Consider the set N of natural numbers: {1,
2, 3, 4,…}
•  Question 1: How big is that set?
•  Question 2: Which is larger – the size of the
set N or the number of hairs on your head?
•  Question 3: Which is larger – the size of the
set N or the number of atoms in the known
universe? Question 4: Is there any set larger
than N?
Countable Infinite Sets
Let’s take a look at the natural numbers:
1, 2, 3, 4, 5, ……
There are an infinite number of these: that is,
the list here will never come to an end.
It may sound strange at first glance, but now
consider the even natural numbers:
2, 4, 6, 8, 10,…
There are an infinite number of even numbers.
And in fact, the set of even numbers has the
same (infinite) size as the set of natural
numbers. The reason this is true is because you can
place one list directly under the other and
make a one-to-one mapping between the
two lists:
1, 2, 3, 4, 5…
2, 4, 6, 8, 10…
Countable Infinite Sets
• 
• 
• 
• 
• 
Natural numbers: (0, 1, 2, ….)
Even numbers: (0, 2, 4, 6, …)
Prime numbers: (2, 3, 5, 7, 11, …)
Integers: (0, -1, 1, -2, 2, -3, 3, …)
Rational numbers
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
Rational numbers are countable!
1/1
!
2/1
!
3/1
!
4/1
1/2
1/3
1/4
1/5
1/6
1/7!
2/2
2/3
2/4
2/5
2/6
2/7!
3/2
3/3
3/4
3/5
3/6
3/7!
4/2
4/3
4/4
4/5
4/6
4/7!
We’ve seen a lot of infinite,
countable sets…
•  Are there any infinite sets that aren’t
countable?
An Uncountable Set
•  All real numbers between 0 and 1:
Numbers like:
0.230412506….
0.14159265…
This set is called the continuum: the set of all points on a
straight line segment. Note that we include here both
rational and irrational numbers.
A proof that the real numbers are
uncountable
•  Suppose we actually tried, somehow, to
make an infinite list that included all real
numbers (between 0 and 1) in some order.
•  Then someone could always find a new real
number that should have been in our list,
but that we’d neglected to include!
Some numbers can’t be computed:
an argument via countable
pigeonholes and uncountable
pigeons
Let’s imagine the following type
of argument:
•  There are only ten possible computer
programs in the whole world…
Let’s imagine the following type
of argument:
•  There are only ten possible computer
programs in the whole world…
•  But there are twenty numbers…
Let’s imagine the following type
of argument:
•  There are only ten possible computer
programs in the whole world…
•  But there are twenty numbers…
•  So there must be some numbers that can’t
be printed out.
Let’s imagine the following type
of argument:
•  There are only a million possible computer
programs in the whole world…
•  But there are sixty million numbers…
•  So there must be some numbers that can’t
be printed out.
Let’s imagine the following type
of argument:
•  There are only a trillion possible computer
programs in the whole world…
•  But there are four hundred trillion
numbers…
•  So there must be some numbers that can’t
be printed out.
Here’s the argument we’re really
going to make:
•  There are an infinite number of possible
computer programs in the whole world…
•  But there are an even larger infinite number
of numbers…
•  So there must be some numbers that can’t
be printed out.
An Initial Question or Two…
•  Suppose you want to pick an 8-character
alphabetic password. How many possible
passwords are there to choose?
•  Suppose, at Starbucks, you have to answer 9
yes-no questions to get a coffee. (Large?
Latte? Sugar?...) How many distinct orders
can there be?
Combinatorics: Two Crucial
Questions about Counting Things
•  Does the order in which you choose things
matter? (In the case of passwords, it does: a
password of ABCDEFGH is different than
ACBDEFGH.)
•  Can you repeat elements? (In the case of
passwords, you can: ABCABBAC is a valid
password.)
Some initial terminology
•  When order matters and you can repeat, you
have a sequence. (Password example.)
•  When order matters and you can’t repeat,
you have an arrangement (or permutation).
Permutations: Some Early
Examples
•  You have ten people and wish to arrange them in a
line; how many ways are there of doing this?
•  There are five teams in the National League East
division; how many possible ways can the teams finish
in the final standings?
•  You wish to visit 100 cities in the United States, with
each city visited just once; how many distinct paths
are there?
•  How many distinct substitution codes are there for
English?
Counting Arrangements of
Distinct Objects
•  Take the case of ten people in a row: there
are 10 choices for the first person; then,
since we’ve chosen the first person, there
are 9 choices for the second; then 8 choices
for the third; and so forth. So overall, there
are 10! (= 10 * 9 * 8 * …. 1) ways of
arranging ten distinct people.
Factorials are LARGE
Stirling’s approximation:
n! ~ sqrt(2pi*n) * (n/e)n
In other words, the factorial function exhibits
exponential growth. Thus, the number of
arrangements of a set of n elements grows
much faster than any polynomial function of
n.
Factorials show up in computer
science…
The “traveling salesman” problem (or
Hamiltonian path problem)
Let’s try a variation…
In a room with 20 people in it, how many
distinct handshakes are there?
Other instances of this same
variation
•  How many ways can you choose a
committee of 3 people from a set of 12?
•  How many distinct 5-card poker hands are
there?
•  In a graph of 100 vertices (and many
edges), how many distinct ways can you
select 8 vertices to look for a “clique” in the
graph?