<jupyter_start><jupyter_text><img src="http://www.cerm.unifi.it/chianti/images/logo%20unifi_positivo.jpg"         alt="UniFI logo" style="float: left; width: 20%; height: 20%;"><NAME>February 4, 2018: exponential PAbstractExponential $\mathcal{P}$, according to <NAME>'s book.<jupyter_code>from sympy import *
from sympy.abc import n, i, N, x, lamda, phi, z, j, r, k, a, alpha

from commons import *
from matrix_functions import *
from sequences import *
import functions_catalog

init_printing()<jupyter_output><empty_output><jupyter_text>---<jupyter_code>m = 10
eP = Matrix(m, m, lambda n,k: factorial(n)*binomial(n,k)/factorial(k))
eP
inspect(eP)
eP_pm = production_matrix(eP)
eP_epm = production_matrix(eP, exp=True)

eP_pm, eP_epm
F = Matrix(m, m, diagonal_func_matrix(factorial))
F_inv = F**(-1)

F, F_inv<jupyter_output><empty_output><jupyter_text>In order to factorize `eP` as `F U F^{-1}`, for some matrix `U`<jupyter_code>B = F_inv * eP * F
B
U = Matrix(m, m, rows_shift_matrix(by=1))
U
F_inv * U * F
F_inv * U * F * B
B**(-1) * F_inv * U * F * B
F * B**(-1) * F_inv * U * F * B * F_inv<jupyter_output><empty_output><jupyter_text>---<jupyter_code>P = Matrix(m, m, binomial)
P_bar = Matrix(m, m, lambda i, j: binomial(i, j) if j < i else 0)
P_bar
production_matrix(P_bar[1:,:-1], exp=False), production_matrix(P_bar[1:,:-1], exp=True)
j=3
(P_bar**j).applyfunc(lambda i: i/factorial(j))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16853932584269662, 'fraction_numerical': 0.016853932584269662, 'mean_word_length': 5.850961538461538, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '294887', 'license': 'MIT', 'n_tokens_mistral': 630, 'n_tokens_neox': 603, 'n_words': 137, 'path': 'notes/matrices-functions/exp-Pascal.ipynb', 'repo_name': 'massimo-nocentini/simulation-methods', 'size': '1439'}