welcome to cs103! - stanford university · pdf filewelcome to cs103! many handouts! course...
TRANSCRIPT
![Page 1: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/1.jpg)
Welcome to CS103!
● Handouts● Course Information● Syllabus
● Today:● Course Overview● Introduction to Set Theory● The Limits of Computation● Problem Set 0 will be posted later today
![Page 2: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/2.jpg)
Are there “laws of physics”in computer science?
![Page 3: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/3.jpg)
Key Questions in CS103
● What problems can you solve with a computer?● Computability Theory
● Why are some problems harder to solve than others?● Complexity Theory
● How can we be certain in our answers to these questions?● Discrete Mathematics
![Page 4: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/4.jpg)
InstructorsCynthia Lee ([email protected])
Head TAGuy Amdur ([email protected])
TAsChioma Agu
Diego HernandezDana MurphyHugo ValdiviaLaetitia Shao
Sudarshan Seshadri
![Page 6: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/6.jpg)
Prerequisite / Corequisite
CS106BThis is a new pre/corequisite this year.
We’ve added in some programming assignments and will be referencing
some concepts from CS106B/X throughout the quarter.
This is a new pre/corequisite this year. We’ve added in some programming assignments and will be referencing
some concepts from CS106B/X throughout the quarter.
There aren't any math prerequisites for this course – high-school algebra should be
enough!
There aren't any math prerequisites for this course – high-school algebra should be
enough!
![Page 7: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/7.jpg)
Problem Set 0
● Your first assignment, Problem Set 0, goes out today. Its’ due Friday at 2:30PM.● There’s no actual coding involved. This is just
to ensure that you get your coding environment set up and know how to submit your work.
![Page 8: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/8.jpg)
Recommended Reading
![Page 9: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/9.jpg)
Online Course Notes
![Page 10: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/10.jpg)
Grading
![Page 11: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/11.jpg)
Problem SetsMidtermsFinal ExamParticipation
Grading
Ten Problem Sets
Problem sets (other than PS0) may be
done individually or in pairs.
Ten Problem Sets
Problem sets (other than PS0) may be
done individually or in pairs.
![Page 12: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/12.jpg)
Problem SetsMidtermsFinal ExamParticipation
Grading
Midterm I
Monday, April 307:00PM – 10:00PM
Midterm I
Monday, April 307:00PM – 10:00PM
Midterm II
Monday, May 217:00PM – 10:00PM
Midterm II
Monday, May 217:00PM – 10:00PM
![Page 13: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/13.jpg)
Problem SetsMidtermsFinal ExamParticipation
Grading
Midterm Score
²/₃ · Higher + ¹/₃ · Lower
Midterm Score
²/₃ · Higher + ¹/₃ · Lower
![Page 14: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/14.jpg)
Problem SetsMidtermsFinal ExamParticipation
Grading
Final Exam
Friday, June 83:30PM – 6:30PM
Final Exam
Friday, June 83:30PM – 6:30PM
![Page 15: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/15.jpg)
Problem SetsMidtermsFinal ExamParticipation
Grading
Lecture Participation
Optional—otherwise this 4% splits between midterm and final.
Lecture Participation
Optional—otherwise this 4% splits between midterm and final.
![Page 16: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/16.jpg)
CS103A
● CS103A is an optional, one-unit add-on course to CS103.
● It provides extra review and practice with the material from CS103 and covers general problem-solving techniques useful in discrete math.
● Similar in spirit to Math 51A, Physics 41A, or Chem 31AC.
● Runs on Tuesdays from 3:00 – 5:00PM in 380-380X, with some time left over at the end for one-on-one questions.
![Page 17: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/17.jpg)
We've got a big journey ahead of us.
Let's get started!
![Page 18: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/18.jpg)
Introduction to Set Theory
![Page 19: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/19.jpg)
“The chemical elements”“Cute animals”
“Cool people”
“US coins”
“All the computers on theStanford network”
“CS103 students”
![Page 20: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/20.jpg)
A set is an unordered collection of distinct objects, which may be anything (including
other sets).
![Page 21: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/21.jpg)
A set is an unordered collection of distinct objects, which may be anything (including
other sets).
, , ,
![Page 22: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/22.jpg)
A set is an unordered collection of distinct objects, which may be anything (including
other sets).
, , ,
Set notation: Curly braces with commas separating out the
elements
Set notation: Curly braces with commas separating out the
elements
![Page 23: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/23.jpg)
Two sets are equal when they have exactly the same contents, ignoring order.
, , ,
![Page 24: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/24.jpg)
Two sets are equal when they have exactly the same contents, ignoring order.
, , ,
, , ,
![Page 25: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/25.jpg)
Two sets are equal when they have exactly the same contents, ignoring order.
, , ,
, , ,
These are the same
set!
These are the same
set!
![Page 26: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/26.jpg)
Sets cannot contain the same object twice. Repeated elements are ignored.
![Page 27: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/27.jpg)
Sets cannot contain the same object twice. Repeated elements are ignored.
,
![Page 28: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/28.jpg)
Sets cannot contain the same object twice. Repeated elements are ignored.
,
, , , , ,
![Page 29: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/29.jpg)
Sets cannot contain the same object twice. Repeated elements are ignored.
,
, , , , ,
These are the same set!
These are the same set!
![Page 30: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/30.jpg)
ØWe use this symbol to denote the empty set.
The empty set contains no elements.
=
![Page 31: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/31.jpg)
![Page 32: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/32.jpg)
Are these objects equal to one another?
1 1≟
This is a number.
This is a number.
This is a set. It contains a number.
This is a set. It contains a number.
![Page 33: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/33.jpg)
Are these objects equal to one another?
1 1≠
This is a number.
This is a number.
This is a set. It contains a number.
This is a set. It contains a number.
![Page 34: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/34.jpg)
Are these objects equal to one another?
Ø Ø≟
This set contains nothing at all.
This set contains nothing at all.
This set has one element, which
happens to be the empty set.
This set has one element, which
happens to be the empty set.
![Page 35: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/35.jpg)
Are these objects equal to one another?
Ø Ø≠
This set contains nothing at all.
This set contains nothing at all.
This set has one element, which
happens to be the empty set.
This set has one element, which
happens to be the empty set.
![Page 36: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/36.jpg)
Membership
![Page 37: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/37.jpg)
Membership
, , ,
![Page 38: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/38.jpg)
Membership
, , ,
Is in this set?
![Page 39: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/39.jpg)
Membership
, , ,
Is in this set?
∈
![Page 40: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/40.jpg)
Membership
, , ,
Is in this set?
∈
![Page 41: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/41.jpg)
Membership
, , ,
Is in this set?
∉
![Page 42: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/42.jpg)
Set Membership
● Given a set S and an object x, we write
x ∈ S
if x is contained in S, and
x ∉ S
otherwise.● If x ∈ S, we say that x is an element of S.● Given any object x and any set S, either
x ∈ S or x ∉ S.
![Page 43: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/43.jpg)
Infinite Sets
● Some sets contain infinitely many elements!● The set ℕ = { 0, 1, 2, 3, …} is the set of all the
natural numbers.● Some mathematicians don't include zero; in this
class, assume that 0 is a natural number.● The set ℤ = { …, -2, -1, 0, 1, 2, … } is the set of
all the integers.● Z is from German “Zahlen.”
● The set ℝ is the set of all real numbers.● e ∈ ℝ, π ∈ ℝ, 4 ∈ ℝ, etc.
![Page 44: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/44.jpg)
Describing Complex Sets
● Here are some English descriptions of infinite sets:
“The set of all even numbers.”
“The set of all real numbers less than 137.”
“The set of all negative integers.”● To describe complex sets like these
mathematically, we'll use set-builder notation.
![Page 45: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/45.jpg)
{ n | n ∈ ℕ and n is even }
Even Natural Numbers
![Page 46: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/46.jpg)
{ n | n ∈ ℕ and n is even }
Even Natural Numbers
![Page 47: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/47.jpg)
{ n | n ∈ ℕ and n is even }
The set of all n
Even Natural Numbers
![Page 48: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/48.jpg)
{ n | n ∈ ℕ and n is even }
The set of all n
Even Natural Numbers
where
![Page 49: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/49.jpg)
{ n | n ∈ ℕ and n is even }
The set of all n
n is a natural number
Even Natural Numbers
where
![Page 50: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/50.jpg)
{ n | n ∈ ℕ and n is even }
The set of all n
n is a natural number
and n is even
Even Natural Numbers
where
![Page 51: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/51.jpg)
{ n | n ∈ ℕ and n is even }
The set of all n
n is a natural number
and n is even
Even Natural Numbers
where
{ 0, 2, 4, 6, 8, 10, 12, 14, 16, … }
![Page 52: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/52.jpg)
Set Builder Notation
● A set may be specified in set-builder notation:
{ x | some property x satisfies }● For example:
{ r | r ∈ ℝ and r < 137 }
{ n | n is an even natural number }
{ S | S is a set of US currency }
{ a | a is cute animal }
{ r ∈ ℝ | r < 137 }
{ n ∈ ℕ | n is odd }
![Page 53: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/53.jpg)
Combining Sets
![Page 54: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/54.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 55: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/55.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 56: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/56.jpg)
Venn Diagrams
A B
A
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 57: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/57.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 58: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/58.jpg)
Venn Diagrams
A B
B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 59: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/59.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 60: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/60.jpg)
Venn Diagrams
A B
A ∪ B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
Union
{ 1, 2, 3, 4, 5 }
![Page 61: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/61.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 62: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/62.jpg)
Venn Diagrams
A B
A ∩ B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
Intersection
{ 3 }
![Page 63: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/63.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 64: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/64.jpg)
Venn Diagrams
A B
A – B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
Difference
{ 1, 2 }
![Page 65: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/65.jpg)
Venn Diagrams
A B
A \ B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
Difference
{ 1, 2 }
![Page 66: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/66.jpg)
Venn Diagrams
A B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
![Page 67: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/67.jpg)
Venn Diagrams
A B
A Δ B
1
2
4
5
3
A = { 1, 2, 3 }B = { 3, 4, 5 }
SymmetricDifference
{ 1, 2, 4, 5 }
![Page 68: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/68.jpg)
Venn Diagrams
![Page 69: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/69.jpg)
Venn Diagrams for Three Sets
![Page 70: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/70.jpg)
Subsets and Power Sets
![Page 71: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/71.jpg)
Subsets
● A set S is called a subset of a set T (denoted S ⊆ T) if all elements of S are also elements of T.
● Examples:● { 1, 2, 3 } ⊆ { 1, 2, 3, 4 }● { b, c } ⊆ { a, b, c, d }● { H, He, Li } ⊆ { H, He, Li }● ℕ ⊆ ℤ (every natural number is an integer)● ℤ ⊆ ℝ (every integer is a real number)
![Page 72: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/72.jpg)
Subsets and Elements
{2}
2
Set S
![Page 73: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/73.jpg)
Subsets and Elements
{2}
2
Set S
∈ S
![Page 74: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/74.jpg)
Subsets and Elements
{2}
2
Set S
∈ S
![Page 75: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/75.jpg)
Subsets and Elements
{2}
2
Set S
∈ S2
![Page 76: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/76.jpg)
Subsets and Elements
{2}
2
Set S
∈ S{2}
![Page 77: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/77.jpg)
Subsets and Elements
{2}
2
Set S
![Page 78: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/78.jpg)
Subsets and Elements
{2}
2
Set S
⊆ S{ , }2
![Page 79: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/79.jpg)
Subsets and Elements
{2}
2
Set S
⊆ S{ , }2
![Page 80: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/80.jpg)
Subsets and Elements
{2}
2
Set S
∉ S{ , }2
![Page 81: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/81.jpg)
Subsets and Elements
{2}
2
Set S
∉ S{ , }2
![Page 82: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/82.jpg)
Subsets and Elements
{2}
2
Set S
∈ S{ }2
![Page 83: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/83.jpg)
Subsets and Elements
{2}
2
Set S
∈ S{ }2
![Page 84: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/84.jpg)
Subsets and Elements
{2}
2
Set S
⊆ S{ }2
![Page 85: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/85.jpg)
Subsets and Elements
{2}
2
Set S
⊆ S{ }2
![Page 86: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/86.jpg)
Subsets and Elements
{2}
2
Set S
⊆ S{ }2
![Page 87: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/87.jpg)
2
Subsets and Elements
{2}
2
Set S
⊆ S
![Page 88: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/88.jpg)
2
Subsets and Elements
{2}
2
Set S
⊆ S(Since 2 isn't a
set.)
(Since 2 isn't a set.)
![Page 89: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/89.jpg)
Subsets and Elements
● We say that S ∈ T if, among the elements of T, one of them is exactly the object S.
● We say that S ⊆ T if S is a set and every element of S is also an element of T. (S has to be a set for the statement S ⊆ T to be meaningful.)
● Although these concepts are similar, they are not the same! Not all elements of a set are subsets of that set and vice-versa.
● We have a resource on the course website, the Guide to Elements and Subsets, that explores this in more depth.
![Page 90: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/90.jpg)
What About the Empty Set?
● A set S is called a subset of a set T (denoted S ⊆ T) if all elements of S are also elements of T.
● Are there any sets S where Ø ⊆ S?● Equivalently, is there a set S where the
following statement is true?
“All elements of Ø arealso elements of S”
● Yes! In fact, this statement is true for every choice of S!
![Page 91: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/91.jpg)
Vacuous Truth
● A statement of the form
“All objects of type Pare also of type Q”
is called vacuously true if there are no objects of type P.
● Vacuously true statements are true by definition. This is a convention used throughout mathematics.
● Some examples:● All unicorns are pink.● All unicorns are blue.● Every element of Ø is also an element of S.
![Page 92: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/92.jpg)
Vacuous Truth
Can’t find an element of the set for which the statement fails if the set has no elements.
![Page 93: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/93.jpg)
Subsets and Elements
{2}
2
Set S
![Page 94: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/94.jpg)
Subsets and Elements
{2}
2
Set S
Ø ⊆ S
![Page 95: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/95.jpg)
Subsets and Elements
{2}
2
Set S
Ø ⊆ S
![Page 96: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/96.jpg)
Subsets and Elements
{2}
2
Set S
Ø ∉ S
![Page 97: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/97.jpg)
Subsets and Elements
{2}
2
Set S
Ø ∉ S
![Page 98: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/98.jpg)
,,,,
,S =
℘(S) =
The notation (℘ S) denotes the power set of S (the set of all subsets of S).
Formally, (℘ S) = { T | T ⊆ S }
The notation (℘ S) denotes the power set of S (the set of all subsets of S).
Formally, (℘ S) = { T | T ⊆ S }
Ø
![Page 99: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/99.jpg)
What is (Ø)?℘
Answer: {Ø}
Remember that Ø ≠ {Ø}!
![Page 100: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/100.jpg)
Cardinality
![Page 101: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/101.jpg)
Cardinality
![Page 102: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/102.jpg)
Cardinality
● The cardinality of a set is the number of elements it contains.
● If S is a set, we denote its cardinality by writing |S|.
● Examples:● |{a, b, c, d, e}| = 5● |{{a, b}, {c, d, e, f, g}, {h}}| = 3● |{1, 2, 3, 3, 3, 3, 3}| = 3● |{ n ∈ ℕ | n < 137}| = 137
![Page 103: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/103.jpg)
The Cardinality of ℕ
● What is |ℕ|?● There are infinitely many natural numbers.● |ℕ| can't be a natural number, since it's
infinitely large.● We need to introduce a new term.● Definition: |ℕ| = ℵ0
● Pronounced “Aleph-Zero” or “Aleph-Null”
![Page 104: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/104.jpg)
The Cardinality of ℕ
● What is |ℕ|?● There are infinitely many natural numbers.● |ℕ| can't be a natural number, since it's
infinitely large.● We need to introduce a new term.● Let's define ₀ℵ = |ℕ|.
● ₀ ℵ is pronounced “aleph-zero,” “aleph-nought,” or “aleph-null.”
![Page 105: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/105.jpg)
Consider the set
S = { n | n ∈ ℕ and n is even }
What is |S|?
![Page 106: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/106.jpg)
How Big Are These Sets?
, , ,
, ,,
![Page 107: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/107.jpg)
How Big Are These Sets?
, , ,
, ,,
![Page 108: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/108.jpg)
Comparing Cardinalities
● By definition, two sets have the same size if there is a way to pair their elements off without leaving any elements uncovered.
● The intuition:
, , ,
, ,,
![Page 109: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/109.jpg)
,
Comparing Cardinalities
● By definition, two sets have the same size if there is a way to pair their elements off without leaving any elements uncovered.
● The intuition:
, , ,
,,Everything has been
paired up, and this one is all alone.
Everything has been paired up, and this one
is all alone.
![Page 110: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/110.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
0 2 4 6 8 ...
S = { n | n ∈ ℕ and n is even }
ℕ
S
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
![Page 111: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/111.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
0 2 4 6 8 ...
S = { n | n ∈ ℕ and n is even }
ℕ
S
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
![Page 112: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/112.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
0 2 4 6 8 ...
S = { n | n ∈ ℕ and n is even }
ℕ
S
![Page 113: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/113.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
0 2 4 6 8 10 12 14 16 ...
n ↔ 2n
S = { n | n ∈ ℕ and n is even }
|S| = |ℕ| = ₀ℵ
ℕ
S
![Page 114: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/114.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1 0 1 2 3 4 ...
ℕ
ℤ
![Page 115: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/115.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
0 1 2 3 4 ...
ℕ
ℤ
![Page 116: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/116.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
ℕ
ℤ 0 1 2 3 4 5 6 7 8 ...
![Page 117: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/117.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
ℕ
ℤ 0 1 2 3 4 5 6 7 8 ...
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
Two sets have the same size if there is a way to pair their
elements off without leaving any elements uncovered
![Page 118: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/118.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1 0 1 2 3 4 ...
ℕ
ℤ
![Page 119: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/119.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1 0 1 2 3 4 ...
ℕ
ℤ
![Page 120: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/120.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
ℕ
ℤ 0 1 2 3 4 ...
![Page 121: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/121.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
ℕ
ℤ 0 1 2 3 4 ...
![Page 122: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/122.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
... -3 -2 -1
ℕ
ℤ 0 1 2 3 4 ...
Pair nonnegative integers with even natural numbers. n ↔ -(n + 1) / 2 (if n is odd)
![Page 123: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/123.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
-3-2-1
ℕ
ℤ 0 1 2 3 4 ...-4
Pair nonnegative integers with even natural numbers. n ↔ -(n + 1) / 2 (if n is odd)
![Page 124: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/124.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
-3-2-1
ℕ
ℤ 0 1 2 3 4 ...-4
Pair nonnegative integers with even natural numbers. n ↔ -(n + 1) / 2 (if n is odd)
![Page 125: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/125.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
-3-2-1
ℕ
ℤ 0 1 2 3 4 ...-4
Pair nonnegative integers with even natural numbers.Pair negative integers with odd natural numbers.
![Page 126: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/126.jpg)
Infinite Cardinalities
0 1 2 3 4 5 6 7 8 ...
-3-2-1
ℕ
ℤ 0 1 2 3 4 ...-4
Pair nonnegative integers with even natural numbers.Pair negative integers with odd natural numbers.
|ℕ| = |ℤ| = ℵ0
![Page 127: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/127.jpg)
Important Question:
Do all infinite sets havethe same cardinality?
![Page 128: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/128.jpg)
,,,,
,S =
℘(S) = Ø|S| < | (S)|℘
![Page 129: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/129.jpg)
,S =
℘(S) =
,
, ,
Ø
, , ,
, , , ,
, , ,
|S| < | (S)|℘
![Page 130: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/130.jpg)
S = {a, b, c, d}
℘(S) = {Ø,
{a}, {b}, {c}, {d},{a, b}, {a, c}, {a, d}, {b, c}, {b, d}, {c, d}
{a, b, c}, {a, b, d}, {a, c, d}, {b, c, d},{a, b, c, d}
}
|S| < | (℘ S)|
![Page 131: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/131.jpg)
If |S| is infinite, what is therelation between |S| and | (℘ S)|?
Does |S| = | (℘ S)|?
![Page 132: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/132.jpg)
If |S| = | (℘ S)|, we can pair up the elements of S and the elements of (℘ S) without
leaving anything out.
What might this correspondence look like?
![Page 133: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/133.jpg)
If |S| = | (℘ S)|, we can pair up the elements of S and the elements of (℘ S) without
leaving anything out.
What might this correspondence look like?
![Page 134: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/134.jpg)
If |S| = | (℘ S)|, we can pair up the elements of S and the subsets of S without
leaving anything out.
What might this correspondence look like?
![Page 135: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/135.jpg)
If |S| = | (℘ S)|, we can pair up the elements of S and the subsets of S without
leaving anything out.
![Page 136: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/136.jpg)
If |S| = | (℘ S)|, we can pair up the elements of S and the subsets of S without
leaving anything out.
What would that look like?
![Page 137: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/137.jpg)
x0
x2
x3
x4
x5
x1
...
![Page 138: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/138.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
x0
x2
x3
x4
x5
x1
![Page 139: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/139.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 140: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/140.jpg)
{ x0, x2, x4, ...}
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
Y Y YN N N …
![Page 141: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/141.jpg)
{ x0, x3, x4, ...}…
{ x4, ... }
{ x1, x4, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
Y Y Y NN N
![Page 142: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/142.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 143: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/143.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 144: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/144.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 145: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/145.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 146: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/146.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y NN …N YN
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 147: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/147.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y Y Y Y Y …
Y NN …N YN
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 148: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/148.jpg)
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ x0, x2, x4, ... }
{ x0, x3, x4, ... }
{ x4, ... }
{ x1, x4, ... }
{ 0, 2, 4, ... }
{ 0, 2, 4, ... }
{ “b”, “ab”, ... }
{ x0, x1, x2, x3, x4, x5, ... }
...
{ x0, x5, ... }
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y Y Y Y Y …
Y NN …N YN
… … … … … … …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 149: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/149.jpg)
{ 0, 2, 4, ... }
...
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }Y NYN N …N YN
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 150: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/150.jpg)
{ 0, 2, 4, ... }
...
Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }Y NYN N …N YN
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 151: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/151.jpg)
Y NN N N
YN NN
…
Y Y Y NN N …
Y NN N N N …
Y N …
N N NNN …
Y Y Y Y Y Y …
… … … … … …
…Y N N N N Y
…...
Y …
x0, x5, …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
Y Y YN N N
![Page 152: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/152.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … …
…Y N N N N Y
…...
{ 0, 2, 4, ... }{ “b”, “ab”, ... }Y NYN Y …N YN
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 153: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/153.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … …
…Y N N N N Y
…...
{ 0, 2, 4, ... }{ “b”, “ab”, ... }Y NYN Y …N YN
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 154: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/154.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … …
…Y N N N N Y
…...
{ 0, 2, 4, ... }{ “b”, “ab”, ... }Y NYN Y …N YN
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 155: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/155.jpg)
…
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
…
Y Y Y Y Y Y …
… … … … … …
…Y N N N N Y
…...
…
Flip all Y's to N's and vice-versa to
get a new set
Flip all Y's to N's and vice-versa to
get a new set
N Y Y Y N ...Y
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
Y NN N YN
Y Y YN N N
![Page 156: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/156.jpg)
Y …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
…
Y Y Y Y Y Y …
… … … … … … …...
…
Flip all Y's to N's and vice-versa to
get a new set
Flip all Y's to N's and vice-versa to
get a new set
N Y Y Y N ...Yx2, x3, x4, ...x1,
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
Y NN N YN
Y YN N N
![Page 157: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/157.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 158: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/158.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 159: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/159.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 160: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/160.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 161: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/161.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 162: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/162.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 163: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/163.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 164: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/164.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y Y N ...
...
Y NYN N …N YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 165: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/165.jpg)
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
...
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 166: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/166.jpg)
...
{ 0, 2, 4, ... }Y Y YN N N …
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y Y NNNN …
Y Y Y Y Y Y …
… … … … … … …
Y N N N Y YN Y Y Y N N ...
...
Y NYN N …N
Y
YN
Which row in the table is paired with this set?
Which row in the table is paired with this set?
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 167: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/167.jpg)
NN N YN
Y Y YN N N …
...
Y Y Y NN N …
Y NN N N N …
Y Y NN NN …
Y …
Y Y Y Y Y Y …
… … … … … … …
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 168: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/168.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 169: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/169.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 170: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/170.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…N Y N N N Y
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 171: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/171.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 172: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/172.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 173: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/173.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 174: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/174.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 175: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/175.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 176: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/176.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 177: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/177.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 178: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/178.jpg)
{ 0, 2, 4, ... }
...
N N NN N Y …
Y Y Y YY Y …
Y NN Y N Y …
N Y NY NY …
Y Y NNNN …
Y N N N N Y …
… … … … … … …
{ 0, 2, 4, ... }{ “b”, “ab”, ... }N NYN N …Y YY
…Y N Y Y Y N
x0
x2
x3
x4
x5
x1
x0 x1 x2 x3 x4 x5 ...
![Page 179: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/179.jpg)
The Diagonalization Proof
● No matter how we pair up elements of S and subsets of S, the complemented diagonal won't appear in the table.
● In row n, the nth element must be wrong.● No matter how we pair up elements of S and
subsets of S, there is always at least one subset left over.
● This result is Cantor's theorem: Every set is strictly smaller than its power set:
If S is a set, then |S| < | (℘ S)|.
![Page 180: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/180.jpg)
Infinite Cardinalities
● By Cantor's Theorem:
|ℕ| < | (ℕ)|℘
| (ℕ)| < | ( (ℕ))|℘ ℘℘
| ( (ℕ))| < | ( ( (ℕ)))|℘℘ ℘℘℘
| ( ( (ℕ)))| < | ( ( ( (ℕ))))|℘℘℘ ℘℘℘℘
… ● Not all infinite sets have the same size!
● There is no biggest infinity!
● There are infinitely many infinities!
![Page 181: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/181.jpg)
What does this have to dowith computation?
![Page 182: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/182.jpg)
“The set of all computer programs”
“The set of all problems to solve”
![Page 183: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/183.jpg)
Where We're Going
● A string is a sequence of characters.● We're going to prove the following results:
● There are at most as many programs as there are strings.
● There are at least as many problems as there are sets of strings.
● This leads to some incredible results – we'll see why in a minute!
![Page 184: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/184.jpg)
Where We're Going
A string is a sequence of characters.
We're going to prove the following results:● There are at most as many programs as there
are strings.
There are at least as many problems as there are sets of strings.
This leads to some incredible results – we'll see why in a minute!
![Page 185: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/185.jpg)
Strings and Programs
● The source code of a computer program is just a (long, structured, well-commented) string of text.
● All programs are strings, but not all strings are necessarily programs.
All possibleprograms
All possiblestrings
|Programs| ≤ |Strings|
![Page 186: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/186.jpg)
Where We're Going
● A string is a sequence of characters.● We're going to prove the following results:
● There are at most as many programs as there are strings.
● There are at least as many problems as there are sets of strings.
● This leads to some incredible results – we'll see why in a minute!
![Page 187: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/187.jpg)
Where We're Going
● A string is a sequence of characters.● We're going to prove the following results:
● There are at most as many programs as there are strings. ✓
● There are at least as many problems as there are sets of strings.
● This leads to some incredible results – we'll see why in a minute!
![Page 188: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/188.jpg)
Where We're Going
A string is a sequence of characters.
We're going to prove the following results:
There are at most as many programs as there are strings. ✓
● There are at least as many problems as there are sets of strings.
This leads to some incredible results – we'll see why in a minute!
![Page 189: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/189.jpg)
Strings and Problems
● There is a connection between the number of sets of strings and the number of problems to solve.
● Let S be any set of strings. This set S gives rise to a problem to solve:
Given a string w, determine whether w ∈ S.
![Page 190: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/190.jpg)
Strings and Problems
Given a string w, determine whether w ∈ S.
● Suppose that S is the set
S = { "a", "b", "c", …, "z" }● From this set S, we get this problem:
Given a string w, determine whetherw is a single lower-case English letter.
![Page 191: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/191.jpg)
Strings and Problems
Given a string w, determine whether w ∈ S.
● Suppose that S is the set
S = { "0", "1", "2", …, "9", "10", "11", ... }● From this set S, we get this problem:
Given a string w, determine whetherw represents a natural number.
![Page 192: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/192.jpg)
Strings and Problems
Given a string w, determine whether w ∈ S.
● Suppose that S is the set
S = { p | p is a legal Java program }● From this set S, we get this problem:
Given a string w, determine whetherw is a legal Java program.
![Page 193: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/193.jpg)
Strings and Problems
● Every set of strings gives rise to a unique problem to solve.
● Other problems exist as well.
Problemsformed from
sets of strings
All possibleproblems
|Sets of Strings| ≤ |Problems|
![Page 194: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/194.jpg)
Where We're Going
● A string is a sequence of characters.● We're going to prove the following results:
● There are at most as many programs as there are strings. ✓
● There are at least as many problems as there are sets of strings.
● This leads to some incredible results – we'll see why in a minute!
![Page 195: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/195.jpg)
Where We're Going
● A string is a sequence of characters.● We're going to prove the following results:
● There are at most as many programs as there are strings. ✓
● There are at least as many problems as there are sets of strings. ✓
● This leads to some incredible results – we'll see why in a minute!
![Page 196: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/196.jpg)
Where We're Going
A string is a sequence of characters.
We're going to prove the following results:
There are at most as many programs as there are strings. ✓
There are at least as many problems as there are sets of strings. ✓
● This leads to some incredible results – we'll see why in a minute!
![Page 197: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/197.jpg)
Where We're Going
A string is a sequence of characters.
We're going to prove the following results:
There are at most as many programs as there are strings. ✓
There are at least as many problems as there are sets of strings. ✓
● This leads to some incredible results – we'll see why in a minute! right now!
![Page 198: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/198.jpg)
Every computer program is a string.
So, the number of programs is at most the number of strings.
From Cantor's Theorem, we know that there are more sets of strings than strings.
There are at least as many problemsas there are sets of strings.
|Programs| |Strings| |Sets of Strings| |Problems|≤ ≤<
![Page 199: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/199.jpg)
|Programs| < |Problems|
Every computer program is a string.
So, the number of programs is at most the number of strings.
From Cantor's Theorem, we know that there are more sets of strings than strings.
There are at least as many problemsas there are sets of strings.
![Page 200: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/200.jpg)
|Programs| < |Problems|
There are more problems tosolve than there are programs
to solve them.
![Page 201: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/201.jpg)
It Gets Worse
● Using more advanced set theory, we can show that there are infinitely more problems than solutions.
● In fact, if you pick a totally random problem, the probability that you can solve it is zero.
● More troubling fact: We've just shown that some problems are impossible to solve with computers, but we don't know which problems those are!
![Page 202: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/202.jpg)
We need to develop a more nuanced understanding of computation.
![Page 203: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/203.jpg)
Where We're Going● What makes a problem impossible to solve
with computers?● Is there a deep reason why certain problems can't be
solved with computers, or is it completely arbitrary?● How do you know when you're looking at an
impossible problem?● Are these real-world problems, or are they highly
contrived?● How do we know that we're right?
● How can we back up our pictures with rigorous proofs?
● How do we build a mathematical framework for studying computation?
![Page 204: Welcome to CS103! - Stanford University · PDF fileWelcome to CS103! Many Handouts! Course Information Syllabus Problem Set 0 (There’s some other ones that are only available online](https://reader031.vdocuments.us/reader031/viewer/2022021501/5abc2dcd7f8b9a567c8d8608/html5/thumbnails/204.jpg)
Next Time
● Mathematical Proof● What is a mathematical proof?● How can we prove things with certainty?