<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Homework 2
A European Put option allows you to sell an asset at time $T$ for a price $k$. In
some way, it is the opposite of the call option discussed in class. It’s payoff is
$\max(k − S_T ,0)$. Use these specifications
Step1:  Now that we have this function, we can use the samples to compute the expected price at time $T$.
Step2:  Instead of computing the expected price for the first 5 points, i.e. for $T=1,\ldots,5,$ let us instead do it for the first 100. This shows how the expected price drops after a while.
<ASSISTANT_TASK:>
Python Code:
def pricingSamples(T, number_of_samples,S0=25, SIGMA=1,
                   R=0.01, K=25):
    '''
        Produces samples of the selling price of an asset at time t=T,
        given the parameters above. 
    '''
    
    z = randn(number_of_samples)
    s_T = S0*np.exp((R-0.5*SIGMA**2)*T+SIGMA*np.sqrt(T)*z)
    c = np.exp(-R*T)*(K-s_T)*((K-s_T)>0)
    return c
Explanation: Homework 2
A European Put option allows you to sell an asset at time $T$ for a price $k$. In
some way, it is the opposite of the call option discussed in class. It’s payoff is
$\max(k − S_T ,0)$. Use these specifications: $S_0 = 25, \sigma = 1, r = 0.01, K = 25$,and compute the prices of the option at times $T = 1,\ldots, 5$. You don’t need to derive an analytic
solution. It is enough to use one of the proposed approximation methods.
We will need a function that can produce the samples we require.
End of explanation
def PriceOption(T, num_of_samples=10000,S0=25, SIGMA=1,
                   R=0.01, K=25):
    '''
        Computes the expected price at time T given
        samples. 
    '''
    
    samples = pricingSamples(T, num_of_samples)
    aver_price = np.mean(samples)
    return aver_price 
Explanation: Now that we have this function, we can use the samples to compute the expected price at time $T$.
End of explanation
prices = np.zeros(100);
for i in range(1,100):
    prices[i] = PriceOption(i);
pale_red = sns.xkcd_rgb['pale red']    
pl.plot(prices,color=pale_red)
pl.xlabel('Time',fontsize=20)
pl.ylabel('Expected Price',fontsize=20)
pl.title('Using 10000 samples.', fontsize=20)
Explanation: Instead of computing the expected price for the first 5 points, i.e. for $T=1,\ldots,5,$ let us instead do it for the first 100. This shows how the expected price drops after a while.
End of explanation
<END_TASK>