HW2 due - TAMU Computer Science Faculty Pages

advertisement
CSCE 420 - Fall 2014
Homework #2
due: Tuesday, December 9, 2014 (in class)
1. Suppose you have written a file-management agent that wants to determine whether file 'a' (e.g.
'HW1.txt') on your laptop ('l') is the same as file 'b' (e.g. 'HW1.corrected') on your school/work
computer ('w'). The agent could do this using the unix 'diff' command. However, both files have to be
on the same computer. Luckily, the agent can use 'ftp' to copy files between machines. Of course,
doing ftp and running diff requires having the password to the destination machine. Using backchaining, prove that, after ftp'ing 'a' from your laptop to your computer and doing diff with 'b' on
computer 'w', the agent will know whether the two files are the same. Write all the axioms in Situation
Calculus for the operators that are needed to make this proof work.
initial state: on(a,l,s0), on(b,w,s0), have_password(w,s)
prove: know_whether_same(a,b,res(diff(a,b,w),res(ftp(a,l,w,s0))
2. Bayesian Inference
Consider 2 factors that influence whether a student passes a given test: a) being smart, and b) studying.
Suppose 30% of students believe they are intrinsically smart. But since students do not know a priori
whether they are smart enough to pass a test, suppose 40% of will study for it anyway. (Assume Smart
and Study are independent). The causal relationship ship of these variables on the probability of
actually passing the test, P(pass|Smart,Study), can be expressed in a conditional probability table (CPT)
as follows:
CPT for pass
study
study
smart
0.2
0.6
smart
0.7
0.95
prior probabilities: P(smart)=0.3, P(study)=0.4
a) Calculate all the entries in the full joint probability table (JPT) [a 4x2 matrix, like Fig 13.3 in the text
book; it is OK to write a small computer program to do this; but you will probably have to write out the
equation for calculating joint probs first]
b) From the JPT, compute the probability that a student is smart, given that they pass the test but did
not study.
c) From the JPT, compute the probability that a student did not study, given that they are smart but did
not pass the test.
d) Compute the marginal probability that a student will pass the test given that they are smart.
e) Compute the marginal probability that a student will pass the test given that they study.
Download