<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Conclusion
I hope you enjoyed the lecture and could do crazy bayesian stuff in your next job as data scientist !
Check list
Understand what machine learning is in terms of probabilites 
Can get started in constructing probabilistic graphical models using pgmpy
Can get started in building bayesian models in pymc
Understand the difference between frequentist and bayesian machine learning 
Understand regression in bayesian settings 
Understand when to prefere bayesian machine learning over other approaches 
Homework 1
Step1:  Homework 2
Step2:  Homework 3
<ASSISTANT_TASK:>
Python Code:
#your code here
Explanation: Conclusion
I hope you enjoyed the lecture and could do crazy bayesian stuff in your next job as data scientist !
Check list
Understand what machine learning is in terms of probabilites 
Can get started in constructing probabilistic graphical models using pgmpy
Can get started in building bayesian models in pymc
Understand the difference between frequentist and bayesian machine learning 
Understand regression in bayesian settings 
Understand when to prefere bayesian machine learning over other approaches 
Homework 1:  Monti hal problem
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/3/3f/Monty_open_door.svg/220px-Monty_open_door.svg.png"/>
write a code to help you pass the game show ?
End of explanation
# Your true distance 
import numpy as np
import pymc as pm
import math
import matplotlib.pyplot as plt
import random
import scipy as sci
%matplotlib inline
def noisyDistance(x, y, noiseSigma):
    return np.sqrt(((x - y) ** 2).sum()) + sci.stats.norm.rvs(0, noiseSigma)
def generateData(landscapeSize, numCommTowers, noiseSigma):
    towersTrueLocation = [np.array([random.random() * landscapeSize, random.random()* landscapeSize]) for i in range(0, numCommTowers)]
    yourTrueLocation = np.array([random.random() * landscapeSize, random.random() * landscapeSize ])
    noisyDistances = [noisyDistance(i, yourTrueLocation, noiseSigma) for i in towersTrueLocation]
    return (towersTrueLocation, yourTrueLocation, noisyDistances)
def drawLandscape(landscapeSize, towersTrueLocation, yourTrueLocation, estimatedLocations = None):
    plt.xlim(0, landscapeSize)
    plt.ylim(0, landscapeSize)
    for i in towersTrueLocation:
        plt.scatter(i[0], i[1],  marker='+')
    plt.scatter(yourTrueLocation[0], yourTrueLocation[1],  marker='*', color = 'red')
    if estimatedLocations is not None:
        for i in estimatedLocations:
            plt.scatter(i[0], i[1],  marker='o')
(towersTrueLocation, yourTrueLocation, noisyDistances) = generateData(10000, 25, 50)
drawLandscape(10000, towersTrueLocation, yourTrueLocation)
print ("True towers locations: ", towersTrueLocation, "\n")
print ("Your true location: ", yourTrueLocation, "\n")
print ("Noisy distances: ", noisyDistances)
# Your code here
Explanation: Homework 2: Localization
Suppose you are in a mobile car, and you can sense the noisy distnace between you and fixed communication towers (using signal stright).
Can you estimate your true location ?
End of explanation
from matplotlib.pyplot import hist
from numpy.random import normal
import random
data = [normal(55, 5) for i in xrange(100)]
data += [normal(85, 5) for i in xrange(100)]
random.shuffle(data)
hist(data, 20)
#your code here
Explanation: Homework 3: Mixture of Gaussians
On statistics example, the prof found that there are two peaks in the curve of students scores, he speculate the reason is due to variation in the university students acceptance standards (Elmoazi !). 
Could help him to rediscover the students two groups.
End of explanation
<END_TASK>