Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: b36fe569ca
Fetching contributors…

Cannot retrieve contributors at this time

174 lines (173 sloc) 5.134 kB
(midterm
(1)
(2-a*-search
(heuristic-function
(labeled "h")
(indicated on graph)
(h=15
(h=11
(h=2))
(h=8
(h=3)
(h=9))
(h=7)
(h=6
(h=5)
(h=20
(h=0 GOAL)))
(h=10
(h=0 GOAL)))
(actions
(cost 10 per step)))
(enter into the graph the order when the node is expanded
(that is the same as removed from the queue in a*)
(start with 1 at the top)
(enter 0 if the node will never be expanded))
(is the heuristic h admissiable?))
(3-probability-1
(coin x
(= (probability (= x head))
0.3)
what is (probability (= x tails))
?))
(4-probability-2
(= (probability (= heads-twice x))
0.04)
(what is (probability (= tails-twice x))
(= (expt (- 1 (sqrt 0.04)) 2)
(expt (- 1 0.2) 2)
(expt 0.8 2)
0.64))
(5-probability-3
(2 coins
(= (probability (= heads x1))
0.5)
(= (probability (= heads x2))
1))
(pick a coin at random, call it "c0"
(flip coin, see "heads"
(what is (probability (= loaded-coin c0)))
(flip coin again, see "heads"
(what is (probability (= loaded-coin c0)))))))
(6-bayes-network-1
(((a b
(e
(g h)))
(c d
(f
(h i))))
((independent a b)
? #t)
((independent a b #:given e)
? #f)
((indepednent a b #:given g)
? #f)
((independent a b #:given f)
? #t)
((independent a c #:given g))))
(7-bayes-network-2
(given this bayes network
((a
(b c))
(= (probability a)
0.5)
(= (conditional-probability b #:given a)
0.2)
(= (conditional-probability b #:given (not a))
0.2)
(= (conditional-probability c #:given a)
0.8)
(= (conditional-probability c #:given (not a))
0.4))
(what is (conditional-probability b #:given c)
(= (conditional_probabilty b #:given c)
(/ (probability b c)
(probability c))
(/ (* (probability b)
(probability c))
(probability c))
(/ (* (+ (* (conditional-probability b #:given a)
(probability a))
(* (conditional-probability b #:given (not a))
(probability (not a))))
(+ (* (conditional-probability c #:given a)
(probability a))
(* (conditional-probability c #:given (not a))
(probability (not a)))))
(+ (* (conditional-probability c #:given a)
(probability a))
(* (conditional-probability c #:given (not a))
(probability (not a)))))
(/ (* (+ (* 0.2 0.5)
(* 0.2 0.5))
(+ (* 0.8 0.5)
(* 0.4 0.5)))
(+ (* 0.8 0.5)
(* 0.4 0.5)))
(/ 1 5)))
(what is (conditional-probability c #:given b)
(= (conditional-probability c #:given b)
(/ (probability b c)
(probability b))
(/ (* (probability b)
(probability c))
(probability b))
(/ (* (+ (* (conditional-probability b #:given a)
(probability a))
(* (conditional-probability b #:given (not a))
(probability (not a))))
(+ (* (conditional-probability c #:given a)
(probability a))
(* (conditional-probability c#:given (not a))
(probability (not a)))))
(+ (* (conditional-probability b #:given a)
(probability a))
(* (conditional-probability b #:given (not a))
(probability (not a)))))
(/ (* (+ (* 0.2
0.5)
(* 0.2
0.5))
(+ (* 0.8
0.5)
(* 0.4
0.5)))
(+ (* 0.2
0.5)
(* 0.2
0.5)))
(/ 3 5)))))
(8-naive-bayes-with-laplacian-smoothing
(we have two classes of movies
'(old
("top gun" "shy people" "top hat"))
'(new
("top gear" "gun shy")))
(use laplacian smoothing with (= k 1)
(compute (= (probability 'old)
(laplace-smoothing 1 2 5 3))
(= (conditional-probability "top" #:given 'old)
(laplace-smoothing (length dictionary) 6 2))
(= (conditional-probability 'old #:given "top")
(/ (* (conditional-probability "top" #:given 'old)
(probability 'old))
(+ (* (conditional-probability 'old #:given "top")
(probability 'old))
(* (conditional-probability 'new #:given "top")
(probability 'new))))))))
(9-k-nearest-neighbor
(given the following labeled data set
(? + + + - - - -)
for what (minimal)
value of k will the query point "?" be negative? Enter 0 if this is
impossible. ties are broken at random - try to avoid them.
(7)))
(10-linear-regression
(we have the following data
'((1 2)
(3 5.2)
(4 6.8)
(5 8.4)
(9 14.8)))
(perform linear regression: y = w1 * x + w0)
(what is w1?)))
Jump to Line
Something went wrong with that request. Please try again.