Homework 2
CSE 3502 - Theory of Computation
Assigned: September 8, 2015 Due on: September 17, 2015
Note: Please read the instructions for submitting homework and follow the homework policy
given on HuskyCT; submissions not following these guidelines will
Homework 6
CSE 3502 - Theory of Computation
Assigned: October 20, 2015 Due on: October 29, 2015
Note: Please read the instructions for submitting homework and follow the homework policy
given on HuskyCT; submissions not following these guidelines will not
Homework 5
CSE 3502 - Theory of Computation
Assigned: October 13, 2015 Due on: October 22, 2015
Note: Please read the instructions for submitting homework and follow the homework policy
given on HuskyCT; submissions not following these guidelines will not
Big picture
All languages
Decidable
Turing machines
NP
P
Context-free
Context-free grammars, push-down automata
Regular
Automata, non-deterministic automata,
regular expressions
Turing Machines
Like DFA but
Access to infinite tape,
1 0 0 1 .
initially con
Data structures
Organize your data to support various queries using little
time and/or space
Given n elements A[1.n]
Support SEARCH(A,x) := is x in A?
Trivial solution: scan A. Takes time (n)
Best possible given A, x.
What if we are first given A, are all
Circuits
TM: A single program that works for every input length
Circuits: A program tailored to a specific input length
Motivation:
-that's what computers really are
-cryptography: attackers focus on specific key length
-more combinatorial, should be easi
Graph Algorithms
Representations of graph G with vertices V and edges E
V x V adjacency-matrix A: Au, v = 1 (u, v) E
Size: |V|2
Better for dense graphs, i.e., |E| = (|V|2)
Adjaceny-list, e.g. (v1 , v5 ), (v1 , v17 ), (v2 , v3 )
Size: O(E)
Better for sp
Kolmogorov Complexity
Suppose I say I tossed a coin 40 times and got:
1010101010101010101010101010101010101010
Suppose I say I tossed a coin 40 times and got:
1010101010101010101010101010101010101010
You don't believe me
Suppose I say I tossed a coin 40 t
Lower bounds
We prove that SAT cannot be solved by an algorithm that runs
in space O(log n) and uses time nc for a constant c > 1.
This algorithm is allowed random-access to input.
(Without this, n2 time lower bounds hold for palindromes)
The best-known r
Misc
What's a reduction?
Tapes,
NTIME, NEXP,
Padding,
PH
What is a reduction from A to B? It's the concept that if you
can do B, then you can also do A.
For example, buying a house reduces to becoming
millionaire;
seeing the Colosseum reduces to flying t
5
The Operational Amplier
Assessment Problems
AP 5.1 [a] This is an inverting amplier, so
vo = (Rf /Ri )vs = (80/16)vs ,
vs ( V)
0.4
2.0
vo ( V) 2.0 10.0
so
vo = 5vs
3.5 0.6 1.6 2.4
15.0
3.0
8.0
10.0
Two of the values, 3.5 V and 2.4 V, cause the op amp to
Chapter 7
Problems
1. Let X = 1 if the coin toss lands heads, and let it equal 0 otherwise. Also, let Y denote the value that shows up on the die. Then, with p(i, j) = Pcfw_X = i, Y = j E[return] =
j =1
6
2 jp (1, j ) +
2 p(0, j )
j =1
6
j
=
2. (a) 6 6 9
Chapter 8
Problems
1. 2. Pcfw_0 X 40 = 1 - Pcfw_X - 20 > 20 1 - 20/400 = 19/20 (a) Pcfw_X 85 E[X]/85 = 15/17 (b) Pcfw_65 X 85) = 1 - Pcfw_X - 75 > 10 1 - 25/100
(c) P 3.
X
i =1
n
i
25 so need n = 10 / n - 75 > 5 25n
Let Z be a standard normal random va
Chapter 10
1. (a) After stage k the algorithm has generated a random permutation of 1, 2, ., k. It then puts element k + 1 in position k + 1; randomly chooses one of the positions 1, ., k + 1 and interchanges the element in that position with element k +
Julie Cappello
ECE 2001W 001
September 25, 2012
Computer Tools Session
E1. Resistive Circuit (DC Sweep Analysis)
Use a DC sweep of the voltage source and plot the resulting value of VX. (The voltage
source is called VSRC and it resides in the SOURCE libra
Circuit Variables
1
Assessment Problems
AP 1.1 Use a product of ratios to convert two-thirds the speed of light from meters
per second to miles per second:
2 3 108 m 100 cm
1 in
1 ft
1 mile
124,274.24 miles
=
3
1s
1m
2.54 cm 12 in 5280 feet
1s
Now set up
Circuit Elements
2
Assessment Problems
a
AP 2.1
[a] Note that the current ib is in the same circuit branch as the 8 A current
source; however, ib is dened in the opposite direction of the current
source. Therefore,
i b = 8 A
Next, note that the dependent
4
Techniques of Circuit Analysis
Assessment Problems
AP 4.1 [a] Redraw the circuit, labeling the reference node and the two node voltages:
The two node voltage equations are
v1
v1 v1 v2
+
+
=0
15 +
60 15
5
v2 v2 v1
5+
+
=0
2
5
Place these equations in sta
Big-Oh
Definition:
f(n) = O(g(n) means
n0, c > 0 n N n n0,
f(n) cg(n)
Meaning: f grows no faster than g, up to constant factors
Big-Oh
Definition:
f(n) = O(g(n) means
n0, c > 0 n N n n0,
f(n) cg(n)
Example 1:
10n = O(n log n) ?
c =?, n0= ? such that n n
Randomized
Complexity
Classes
We allow TM to toss coins/throw dice etc.
We write M(x,R) for output of M on input x, coin tosses R
Def: L RP <=> poly-time randomized M :
x L => PrR [M(x,R)=1] 1/2
x L => PrR [M(x,R)=1] = 0
Def: L BPP <=> poly-time random
Life can only be understood backwards;
but it must be lived forwards.
Soren Kierkegaard
Dynamic programming
It has nothing to do with programming languages
Problem: Input w1 w2 wn , t each 0 wi k
Output: Number of inputs x cfw_0,1n : wi xi = t
Let's try a