6.00 Handout, Lecture 2
(Not intended to make sense outside of lecture)
x = 3 #Create variable x and assign value 3 to it
x = x*x #Bind x to value 9
print x
y = float(raw_input('Enter a number: ')
pri
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 3
Due September 29, 2010
1. The hats o
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 2
Due September 22, 2010
1. Most morni
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 2: Solutions
Due September 22, 2010
1.
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Spring 2010)
Problem Set 1
Due: September 15, 2010
1. Express
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 1: Solutions
Due: September 15, 2010
1
6.006 Introduction to Algorithms
Recitation 24
December 14, 2011
Problem 1. Guess Who? (Spring, 2011 Final)
Woody the woodcutter will cut a given log of wood, at any place you choose, for a price equa
6.006 Introduction to Algorithms
Recitation 19
November 23, 2011
The Knapsack Problem
You nd yourself in a vault chock full of valuable items. However, you only brought a knapsack
of capacity S pounds
6.006 Introduction to Algorithms
Recitation 19
November 23, 2011
Dynamic Programming
Dynamic Programming (DP) is used heavily in optimization problems (nding the maximum and
the minimum of something).
6.006 Introduction to Algorithms
Recitation 20
November 30, 2011
Perfect-Information Blackjack
Lets remember what we covered in lecture. Suppose that we want to play Blackjack against a
dealer (with n
6.006 Introduction to Algorithms
Recitation 18
November 16, 2011
Numerics
Spring 2011 Final, Problem 3c. Compute 3 6006 using two iterations of Newtons method, i.e.,
ll out the following table. Your e
6.006 Introduction to Algorithms
Recitation 16
November 9, 2011
Rubiks Cube
The Rubiks Cube problem in Problem Set 6 maps all possible congurations of the Rubiks cube
as vertices in a graph, and uses
6.006 Introduction to Algorithms
Recitation 15
November 4, 2011
BFS for shortest paths
In the general case, BFS cant be used to nd shortest paths, because it doesnt account for edge
weights. If every
6.006 Introduction to Algorithms
Recitation 14
November 2, 2011
DFS Edge Classication
The edges we traverse as we execute a depth-rst search can be classied into four edge types.
During a DFS executio
6.006 Intro to Algorithms
Recitation 12
October 26, 2011
Newtons Method
Find root of f (x) = 0 through successive approximation e.g., f (x) = x2 a
xi
xi+1
y = f(x)
Figure 1: Newtons Method.
Tangent at
6.006 Introduction to Algorithms
Recitation 13
October 28, 2011
Review on Graphs
Handshaking Lemma
In a party, people shook hands with each other. The sum of the number of times each person shook
hand
6.006 Introduction to Algorithms
Recitation 15
November 4, 2011
Shortest Path and BFS
In the past, we were able to use breadth-rst search to nd the shortest paths between a source
vertex to all other
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 3 Solutions
Due September 29, 2010
1.
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 4
Due October 6, 2010
1. Random variab
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 5
Due October 18, 2010
1. Random varia
#x = 3 #Create variable x and assign value 3 to it
#x = x*x #Bind x to value 9
#print x
#y = raw_input('enter a number:')
#print type(y)
#print y
#y = float(raw_input('Enter a number: ')
#print type(y
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 11 Solutions
1. Check book solutions .
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 11
Never Due
Covered on Final Exam
1.
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 10 Solutions
1. A nancial parable.
(a)
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 10
Due December 2, 2010 (in recitation
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 9 Solutions
1. (a) Yes, to 0. Applyin
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 9
Due November 22, 2010
1. Random vari
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 8: Solutions
1. (a) We consider a Mark
Massachusetts Institute of Technology
Department of Electrical Engineering & Computer Science
6.041/6.431: Probabilistic Systems Analysis
(Fall 2010)
Problem Set 8
Due November 15, 2010
1. Oscar goes