Starting from:
$35

$29

Homework #6 Solution

Please upload 2 les for this homework. One to include the written part of the homework (problem 1 and 2), and a python le for the second exercise and a python le for the second exercise. In your assignment include the names of the other students you have collaborated with to do the homework problems. The Collaboration Policy for this course is detailed in the syllabus.


Homework exercises:

    1. A robot uses a range sensor that can measure ranges from 0m to 3m. For simplicity assume that the ranges are uniformly distributed in this interval. Unfortunately, the sensor can be faulty. When the sensor is faulty, it constantly outputs a range below 1m regardless of the actual range in the sensor’s measurement cone. We know that the prior probability for a sensor to be faulty is p = 0:01.

Supposed the robot queried the sensor N times, and at every single time, the measurement is below 1m. What is the posterior probability of a sensor fault for N = 1; 2; : : : ; 10. Formulate the corresponding probabilistic model.

    2. A vacuum cleaning robot is equipped with a cleaning unit to clean the oor. Furthermore, the robot has a sensor to detect whether the oor is clean or dirty. Neither the cleaning unit nor the sensor are perfect. From previous experience you know that the robot succeeds in cleaning a dirty oor with a probability of

p(xt+1 = cleanjxt = dirty; ut+1 = vacuum clean) = 0:7;

where xt+1 is the state of the oor after having vacuum-cleaned, ut+1 = vacuum clean is the control command, and xt is the state of the oor before performing the action. The probability that the sensor indicates that the oor is clean although it is dirty is given by p(zt = cleanjxt = dirty) = 0:3, and the probability that the sensor correctly detects a clean oor is given by p(zt = cleanjxt = clean) = 0:9. Unfortunately, you have no knowledge of the state of the oor. However, after cleaning the oor the sensor of the robot indicates that the oor is clean. Compute the probability that the oor is still dirty after the robot has vacuum-cleaned it. Use an apropriate prior distribution on the state of the oor.

    3. Programming Exercise. (i) Implement a function in Python which generates samples from a normal distribution N ( ; 2). The input parameters these functions should be the mean and the variance 2 of the normal distribution. As the only source of randomness, use samples of a uniform distribution. Plot a graph with 10000 samples to see how they shape into a Gaussian distribution.

(ii) Implement a function in Python that simulates the motion of a robot over a line, and which takes as input an initial robot position x0 (a real value), and a sequence of 10 control inputs u0:9 = (u0; : : : ; u9) (sequence of 10 real values). The motion model is described by the equation xt = xt 1 + ut + wt, where wt is a sample generated by a normal distribution with mean 0 and 2 = 1. The output of this function is the sequence of steps of the robot after each time t.

1

Programming guidelines:

The name of your python le should be python program.py with the rst line in the le having your PID as a comment, Ex: # A123456.


The example shown below shows the data structures to be used in python for part (i). The values are merely representative.

= 100 2=15
    • = sample normal distribution( ;  2)

    • = 94:2






















































2

More products