In [2]:
%matplotlib inline
import numpy as np
import sympy as sp
import matplotlib.pyplot as plt
In [3]:
########## 2 ##########
In [4]:
a = np.cos(np.random.rand(1e5) * np.pi)
x = np.linspace(0, np.pi - 1e-2, 1e3)
b = 1 / (2 * np.pi * np.sin(x))
plt.plot(x, b, '.')
#plt.hist(a, bins=100)
plt.show()
In [ ]:
In [147]:
########## 3 ##########
In [ ]:
In [153]:
########## 4 ##########
In [154]:
########## 5 ##########
siz = 1e4
a = 1.60 + np.random.rand(siz) * 0.2
m = 50 + np.random.rand(siz) * 20
b = a / np.power(m, 1/3)
plt.hist(b, bins=40)
plt.show()
In [ ]:
l = np.linspace(50*1.6, 70*1.8, siz)
z = a * m
In [39]:
#######3 6 #####3
f = 0.2
g = 0.9
h = 0.3
c = 0.25
t1 = f *g
t2 = (1-f)*h
c1 = t1*c
c2 = t2*c
cd = (c1/(c1+c2))
In [54]:
(c1 / (c1 + c2)) * f
Out[54]:
In [55]:
pt = f * g + (1 - f) * h
pc = c * pt
In [72]:
(f * (c * f * g) + (1-f) * c * (1-f) * h)
Out[72]:
In [68]:
(1-f) * c * (1-f) * h / pc
Out[68]:
In [66]:
(c * f * g) / pc + c * (1-f) * h / pc
Out[66]:
In [74]:
(c * f * g) / pc + c * (1-f) * h / pc
Out[74]:
In [73]:
(1 - (1-f)) / (f - (1-f))
Out[73]:
In [ ]: