CS3102 Theory of Computation - - PowerPoint PPT Presentation

cs3102 theory of
SMART_READER_LITE
LIVE PREVIEW

CS3102 Theory of Computation - - PowerPoint PPT Presentation

CS3102 Theory of Computation www.cs.virginia.edu/~njb2b/cstheory/s2020 Warm up: 1. Why does math consider infinity? 2. Do infinite things exist IBM 1301 disk storage unit (1961) 28MB capacity $2,100 per month ($18,000 today) Logistics


slide-1
SLIDE 1

CS3102 Theory of Computation

www.cs.virginia.edu/~njb2b/cstheory/s2020 Warm up:

  • 1. Why does math consider infinity?
  • 2. Do infinite things exist

IBM 1301 disk storage unit (1961) 28MB capacity $2,100 per month ($18,000 today)

slide-2
SLIDE 2

Logistics

  • Course registration survey was due Thursday

– Didn’t complete it? No problem! Just do it soon

  • Exercise 0_2 due Tuesday

– Didn’t complete it? No problem (this time)! Just request an extension.

  • Exercise 0_3 due Today

– Pick one of python/java – Didn’t complete it? No problem(this time)! Just request an extension.

  • Exercise due/release dates will be more “batched” going forward,

staggered this time to test out the submission system

  • First Quiz

– Released Tomorrow, due Tuesday

  • Exercises 1_x released tomorrow, see assignments page for deadlines

2

slide-3
SLIDE 3

Last Class

  • What does it mean to “represent” things with

strings?

  • How can we represent natural numbers with

binary strings?

  • How can we count things?
  • What does it mean for a set to be infinite?

3

slide-4
SLIDE 4
  • −80538738812075974 3 +

804357581458175153 + 126021232973356313

– Answer?

  • Nearly everything in math in infinite
  • Everything in computing is finite
  • If the numbers are large enough, computers will

always start to do the math wrong

4

Differences Between “real” computing and Math

slide-5
SLIDE 5

Why bother with infinity?

  • Even though computers

have finite resources, most of the time they are plentiful

5

slide-6
SLIDE 6

How many binary strings of any length?

  • If we don’t limit the length, how many strings are

there?

– ∞?

  • What naturals can/can’t we represent
  • What does it mean to “represent”?

– A surjective mapping from a set of strings onto a set – Ideally a bijection, but not necessary

  • Are there things we can’t represent?

6

slide-7
SLIDE 7

Representing ℕ with binary strings

  • Let 𝑔

∗ 𝑐 = 𝑔 𝑜(𝑐) when 𝑐 = 𝑜

  • For a binary string 𝑐, if 𝑔

∗ 𝑐 = 𝑦, then

𝑔

∗ 0𝑐 = 𝑦

– Leading zeros don’t change the value – Our procedure above gives an onto mapping from binary strings to the natural numbers – We can represent all natural numbers with binary strings

7

slide-8
SLIDE 8

Countablility and Uncountability

  • A set 𝑇 is countable if 𝑇 ≤ |ℕ|

– If 𝑇 = |ℕ|, then 𝑇 is “countably infinite”

  • A set 𝑇 is countable if there is an onto

(surjective) function from ℕ to 𝑇

8

slide-9
SLIDE 9

0,1 ∗ is countable

  • We showed 0,1 ∗ ≥ |ℕ|
  • Countable if 0,1 ∗ ≤ |ℕ|
  • Need to “represent” strings with naturals
  • Idea: build a “list” of all strings, represent

each string by its index in that list

9

slide-10
SLIDE 10

Listing all strings

  • 0,1 0 = ""
  • 0,1 1 = 0,1
  • 0,1 2 = 00,01,10,11
  • 0,1 3 = {000,001,010,011,100,101,110,111}

10

1 2 3 4 5 6 7 8 9 10 11 12 13 14

slide-11
SLIDE 11

How Many Python/Java programs?

  • How do we represent Java/Python programs?
  • How many things can we represent using that

method?

11

slide-12
SLIDE 12

How many functions Σ∗ → Σ∗?

  • Short answer: Too many!

– Uncountable – 𝑔 𝑔: Σ∗ → Σ∗ | > |ℕ|

  • Conclusion: Some functions cannot be

computed by any java/python program

  • How to prove this?

12

slide-13
SLIDE 13

Uncountably many functions

  • If we show a subset of 𝑔 𝑔: Σ∗ → Σ∗} is

uncountable, then 𝑔 𝑔: Σ∗ → Σ∗} is uncountable too

  • Consider just the “yes/no” functions

(decision problems): 𝑔 𝑔: {0,1}∗→ {0,1}}

  • The right-hand column is an infinite binary

string that represents that function

13

𝒄 𝒈 𝒄 “” 1 1 00 1 01 1 10 1 11 1 000 001

slide-14
SLIDE 14

0,1 ∞ > |ℕ|

  • Idea:

– show there is no way to “list” all finited binary strings – Any list of binary strings we could ever try will be leaving out elements of 0,1 ∞

14

slide-15
SLIDE 15

0,1 ∞ > |ℕ|

15

𝑐0 𝑐1 𝑐2 𝑐3 𝑐4 𝑐5 𝑐6 1 1 1 1 1 1 1 1 2 1 1 1 1 3 1 1 1 1 1 4 1 1 1 1 5 1 1 1 1 6 1 1 1 1 … 1 1 Attempt at mapping ℕ to 0,1 ∞ A string that our attempt missed Derive by selecting each 𝑐𝑗 as the

  • pposite of the 𝑐𝑗 from row 𝑗
slide-16
SLIDE 16

0,1 ∞ > |ℕ| proof summary

  • Assume towards reaching a contradiction that 0,1 ∞

is countable

  • This means we can find a bijection 𝑔: ℕ → 0,1 ∞
  • Using 𝑔, we can find 𝑡 ∈ 0,1 ∞ which is not in the

range of 𝑔:

– let bit 𝑗 of 𝑡 be the opposite of bit 𝑗 of 𝑔(𝑗) – This is missing from the range because it must be different from every output (at the position indexed by the input)

16

slide-17
SLIDE 17

Other countable/uncountable sets

  • Countable sets:

– Integers – Rational numbers – Any finite set

  • Uncountable Sets:

– Real numbers – The power set of any infinite set

17

slide-18
SLIDE 18

Cantor’s Theorem

  • For any set 𝑇, 𝑇 < |2𝑇|
  • Even if 𝑇 is infinite!
  • Idea:

– 𝑇 ≤ |2𝑇| (why?) – There cannot be a bijection between 𝑇 and 2𝑡

18

slide-19
SLIDE 19

𝑇 ≠ |2𝑇|

  • Consider, towards reaching a contradiction, that there is a

bijection 𝑔: 𝑇 → 2𝑇

  • Consider the set 𝑄 = {𝑦 ∶ 𝑦 ∈ 𝑇 ∧ 𝑦 ∉ 𝑔(𝑦)}

– What are the “types” of:

  • 𝑇
  • 2𝑇
  • 𝑦
  • 𝑔(𝑦)
  • 𝑄
  • Let 𝑔 𝑞 = 𝑄, is 𝑞 ∈ 𝑄?

19

slide-20
SLIDE 20

Conclusion

  • There are countably many strings

– And therefore binary strings, programs, etc.

  • We can’t write down (or compute) all things

from an uncountable set

  • There are uncountably many functions
  • Some functions can’t be implemented

20