grandes-ecoles 2022 Q34

grandes-ecoles · France · centrale-maths1__psi Not Maths
Using the function \texttt{modifie\_matrice}, write in Python a function \texttt{nb\_tours(p, n)} that takes as arguments a probability $p$ and the order $n$ of the matrices $A _ { k }$ and returns the smallest integer $k$ such that $A _ { k } = - A _ { 0 }$, starting from the matrix $A _ { 0 }$ (the real matrix of order $n$ whose coefficients are all equal to 1).
Using the function \texttt{modifie\_matrice}, write in Python a function \texttt{nb\_tours(p, n)} that takes as arguments a probability $p$ and the order $n$ of the matrices $A _ { k }$ and returns the smallest integer $k$ such that $A _ { k } = - A _ { 0 }$, starting from the matrix $A _ { 0 }$ (the real matrix of order $n$ whose coefficients are all equal to 1).