<jupyter_start><jupyter_text>Box-Muller Algorithm<jupyter_code>z1 = z[:len(z)//2]
z2 = z[len(z)//2:]
x1 = np.sqrt(-2*np.log(z1))*np.cos(2*np.pi*z2)
x2 = np.sqrt(-2*np.log(z1))*np.sin(2*np.pi*z2)
showpdf(x1)
showpdf(x2)
plt.plot(xvals,  np.exp(-xvals**2/2)/np.sqrt(2*np.pi), color='#CC3333')<jupyter_output><empty_output><jupyter_text>Inverse transformation<jupyter_code>z1_ = np.exp(-0.5*(x1**2 + x2**2))
z2_ = (np.angle(x1+1j*x2)/np.pi/2)%1
showpdf(z1_)
showpdf(z2_)<jupyter_output><empty_output><jupyter_text>Survival Function<jupyter_code>showpdf(norm.sf(np.random.randn(10000)))

plt.plot(xvals,  norm.pdf(xvals), color='#CC3333')
showpdf(norm.isf(np.random.random(10000)))<jupyter_output><empty_output><jupyter_text>Log-Norm distribution<jupyter_code>x = np.random.randn(10000)
z = np.exp(x)
plt.plot(xvals, lognorm.pdf(xvals, 1), color='#CC3333')
showpdf(z)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21724524076147816, 'fraction_numerical': 0.06942889137737962, 'mean_word_length': 8.933333333333334, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '449936', 'license': 'MIT', 'n_tokens_mistral': 466, 'n_tokens_neox': 435, 'n_words': 35, 'path': 'notebooks/normalizingflow.ipynb', 'repo_name': 'QuantumBFS/QinHuangDao', 'size': '893'}