Binary Exponentiation

preview_player
Показать описание
How to quickly calculate a¹⁰⁰⁰⁰⁰⁰⁰⁰? Binary exponentiation can do it!
Not only that, but the binary exponentiation algorithm has many other applications, such as computing modular exponentiation in RSA encryption, computing Fibonacci numbers, repeating a linear transformation n times, etc.

Рекомендации по теме
Комментарии
Автор

i can imagine how complex the manim code could be to make something like this, it's just that you've chosen a less-known topic at it's name without clickbait, morocco ioi team is using this as a reference, keep it up!

draido-dev
Автор

Youtube has truly committed a war crime towards your channel.

MahdiFalahy-wr
Автор

great video! Finally found an answer as to how I can evaluate exponents fast for my RSA program. Thank you!

michaelxaviercanonizado
Автор

Man I don't know why you have 485 subs you deserve atleast an 300 k

Bolo
Автор

Ive litterly seen way more popular videos about this topic, but this one actually helps me so much! Nice video, and nice editing

Mr_Ioannis
Автор

Bro just keep going! You're making amazing videos. It's just a matter of time you're going to be a star. Plz don't stop...

atharvnadkarni
Автор

This channel is such a gem! Please consider doing some more videos, don’t give up! These are great, wow can’t believe I’ve found it

alinvarzaru
Автор

Well, I got interested in the question in the last part of the video, so i tried to solve it using c++:
(spoilers)
.
.
.
.
.
.
as a result for my program returned this:
4 3 5 6 2 1
CODE:
#include <iostream>
using namespace std;
int len=6; //number of elements in permutation
int * multPerm(int *a, int *b) //transformation by permutation "a" of the sequence "b"
{
int *result=new int[len];
for(int i=0;i<len;i++)
result[i]=b[a[i]-1];
return result;
}

int main()
{
int *p=new int[len]; //permutation
p[0] = 2;
p[1] = 6;
p[2] = 1;
p[3] = 3;
p[4] = 4;
p[5] = 5;
int *res=new int[len]; //our starting positions
res[0] = 1;
res[1] = 2;
res[2] = 3;
res[3] = 4;
res[4] = 5;
res[5] = 6;
int //power of permutation we want
while(n!=0)
{
if(n&1)
res=multPerm(p, res);
p=multPerm(p, p);
n>>=1;
}
for(int i=0;i<len;i++) //printing result:
cout<<res[i]<<" ";
return 0;
}

Once again thanks for the video👍

СергійМоскаленко-уы
Автор

Does using Chinese Remainder Theorem in binary exponentiation optimize the algorithm?
Need your answer.
If we represent the permutations of k elements as a permutation matrix of order k and use the matrix multiplication algorithm you devised, I think we will get the required result.

PMA_ReginaldBoscoG
Автор

Finally I found someone explaining it ! Arigato Gozaimasuu !

benmezianeyacine
Автор

God damn, great video, Thanks for this !!

simardeepsinghmudhar