



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




David Evans David Evans http://www.cs.virginia.edu/evans http://www.cs.virginia.edu/evans
cs302: Theory of Computationcs302: Theory of Computation University of Virginia Computer ScienceUniversity of Virginia Computer Science
Office hours note: my office hours tomorrow will be 10-11am in my office.
PS6 (the last one) is posted now and will be due Thursday, April 24.
Lecture 22: Classy Complexity Classes 2
Lecture 22: Classy Complexity Classes 3
~1800s – 1960s 1900: Hilbert’s Problems 1936: Turing’s Computable Numbers 1957: Chomsky’s Syntactic Structures
(Mostly) “Dead” field
1960s – 2150? 1960s: Hartmanis and Stearns: Complexity class 1971: Cook/Levin, Karp: P=NP? 1976: Knuth’s O , Ω, Θ Very Open and Alive
From last class:
Lecture 22: Classy Complexity Classes 4
Lecture 22: Classy Complexity Classes 5
f ( n ) ≤≤≤≤ cg ( n ) for all n ≥ n 0.
f ( n ) ≥≥≥≥ cg ( n ) for all n ≥ n 0.
Little-o: < instead of ≤≤≤≤
Lecture 22: Classy Complexity Classes 6
int gaussSum (int m) { int sum = 0; for (int i = 1; i <= m; i++) { sum = sum + i; } return sum; }
Good “cs201/cs216” answer: Θ( n )
What does this mean? What does it assume?
Lecture 22: Classy Complexity Classes 7
int gaussSum (int m) { int sum = 0; for (int i = 1; i <= m; i++) { sum = sum + i; } return sum; }
Assumes: m is unbounded (not true for real Java)
int gaussSum (int m) { int sum = 0; for (int i = 1; i <= m; i++) { sum = sum + i; } return sum; }
Assume m is bounded (e.g., 32-bit integer as in real Java). Then, running time of gaussSum is in O (1).
Assume m is unbounded. Then, the average running time of the + is in Θ(log m ), so the running time of gaussSum is in Θ( m log m ).
Lecture 22: Classy Complexity Classes 9
Why doesn’t log base matter in asymptotic notations?
Lecture 22: Classy Complexity Classes 10
int gaussSum (int m) { int sum = 0; for (int i = 1; i <= m; i++) { sum = sum + i; } return sum; }
Assume the size of the input N is unbounded. Then, m ~ 2 N. The running time of + is in Θ(log m ) = Θ( N ) so the running time of gaussSum is in ΘΘΘΘ (2 NN ) = where N is the size of the input.
Is ΘΘΘΘ (2 NN ) = ΘΘΘΘ (2 N )? Left as small challenge problem (everyone should be able to answer this using definition of ΘΘΘΘ.)
Lecture 22: Classy Complexity Classes 11
int gaussSum (int m) { int sum = 0; for (int i = 1; i <= m; i++) { sum = sum + i; } return sum; } cs201/cs216 answer: Θ( n ) where n is the value of the input
cs302 answer: in ΘΘΘΘ (2 NN ) where N is the size of the input.
cs432 answer: don't analyze Java code, analyze idealized pseudocode and state assumptions clearly. Lecture 22: Classy Complexity Classes 12
From the previous analysis, we know an algorithm that solves it with running time in ΘΘΘΘ ( N 2 N ).
This means the time complexity of the problem is in O ( N 2 N ). But it does not give a tight bound.
Lecture 22: Classy Complexity Classes 19
Recall a Universal TM can simulate every other TM. So, it is certainly possible for a TM to simulate a TM that changes rules and states in response to the input.
Lecture 22: Classy Complexity Classes 20
Humans are more "cognizant" of their shortcomings than TMs. There are several problems that humans understand are impossible to answer, but no TM can simulate the decision that any of these problems are decidedly unsolvable. David Horres
I can't help but quote from South Park: "You see, the basis of all reasoning is the mind's awareness of itself. What we think, the external objects we perceive, are all like actors that come on and off stage. But our consciousness, the stage itself, is always present to us." (Kyle) Hung-in Lam
Lecture 22: Classy Complexity Classes 21
Our brains have the ability to recognize patterns and then use those patterns to filter new data. Since our brains store memories primarily through association rather than just memory addresses, this allows for an integrated, relational system of memories…. Our memories "fade" over time, yet can occasionally be brought back… Eric Montgomery
Lecture 22: Classy Complexity Classes 22
A mind can interact with physical inputs and outputs in real time. The brain is able to make decisions in real time; either a synapse fires or it doesn't. What would happen in a brain model that waited forever for a single binary decision? Would the brain-simulating TM ever be able to make all the decisions necessary for even the tiniest slice of time? Such a TM would probably be eaten by a hungry woof; how embarrassing for such a smart machine! Rachel Miller
"ability to interact with the surrounding environment"
Lecture 22: Classy Complexity Classes 23
Some physicists think space-time can be quantized at about 10-23^ meters and 10-32^ seconds. So, in theory a TM could process analog inputs, but in practice all the atoms in the universe would not be enough to make the tape for the TM…
Lecture 22: Classy Complexity Classes 24
"The brain can function without some of its components, but a TM cannot…." Jalysa Conway
"The human mind is also capable of breaking out of an infinite loop that a TM would be stuck in forever… a person gets bored, something that no TM can emulate. " Timothy Kang
Lecture 22: Classy Complexity Classes 25
Neurons tend to fire in a synchronized way. A group of neurons in one part of the brain, for example, may light up at the same time and cause another group to activate in another region. Finally, neurons are capable of neurogenesis, the creation of new brain cells. A TM, no matter how much use it gets, will always remain a TM. The brain, however, is a muscle that is influenced by many factors, including usage. In fact, even the eldest of living humans can avoid mental breakdown by simply exercising their brains frequently… Christopher Andersen Note: exercising your brain is a good idea for young humans also!
Lecture 22: Classy Complexity Classes 26
link link
Lecture 22: Classy Complexity Classes 27
Luis von Ahn, Manuel Blum and John Langford. Telling Humans and Computers Apart Automatically. Lecture 22: Classy Complexity Classes 28
Lecture 22: Classy Complexity Classes 29