![Program a function mod_exp \( (b, n, m) \) that computes
\[
b^{n} \bmod m
\]
using the algorithm discussed in lecture. No cre](https://media.cheggcdn.com/media/5de/5de7fe1f-67af-4796-9680-da71a6cd8c83/phptUphM2)


PLEASE USE THE ALGORITHM AND PSEUDOCODE EXAMPLE PROVIDED.
PLEASE CODE IN PYTHON USING JUPYTER!!! THANKS
Program a function mod_exp (b,n,m) that computes bnmodm using the algorithm discussed in lecture. No credit will be given to functions that employ any other implementation. For example, if the function implementation simply consists of b??n%m, no credit will be given. The function should satisfy the following: 1. INPUT: - b - positive integer representing the base - n-positive integer representing the exponent - m - positive integer representing the modulo 2. OUTPUT: - the computation of bnmodm if b,n,m are positive integers, 0 otherwise. EXAMPLE: \mod_exp (3,644,645) 36
Corollavy 4.1.4 ALGORITHM | Modular Exponentiation a.6modm GOAL: bnmodm when b,m, and n are large. =(amodm)(bmodm)modm 1. Find the binary expansion of n,n=ak?1?2k?1+?+a1?2+a0?. 2. Use Corollary to THM 4.1.4 to compute bnmodm=bak?1?2k?1?bak?2?2k?2?ba1?2?ba0?modm=[(bak?1?2k?1modm)(bak?2?2k?2?ba1?2?ba0?modm)]modm=[(bak?1?2k?1modm)((bak?2?2k?2modm)bak?3?2k?3?ba1?2?ba0?modm)]modm?
PSEUDOCODE | Modular Exponentiation INPUT: b-integer, m-integer, n=(ak?1?,ak?2?,…,a1?,a0?)2? OUTPUT: bnmodm