Chinese Remainder Theorem, 2-minute Method

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024

ความคิดเห็น • 106

  • @Errichto
    @Errichto  3 ปีที่แล้ว +94

    The trick from 5:19 is useful only when you solve this problem with pen and paper (e.g. during a math test). If you have a computer or calculator then ignore that trick and just check values one by one even if they're big.
    I added English captions, enjoy!

    • @bashisobsolete.pythonismyn6321
      @bashisobsolete.pythonismyn6321 3 ปีที่แล้ว

      Just the other day, I revised modulo. This is perfect timing. Thanks

    • @tejasjaiswal1658
      @tejasjaiswal1658 3 ปีที่แล้ว

      I enjoyed indeed.

    • @masternobody1896
      @masternobody1896 3 ปีที่แล้ว +1

      you are a genius can you give me some tips for gamer like me just started learning coding

    • @johnpaulgrefaldo9670
      @johnpaulgrefaldo9670 3 ปีที่แล้ว

      Thank you so much, this makes my code very efficient

  • @tilakmadichettitheappdeveloper
    @tilakmadichettitheappdeveloper 3 ปีที่แล้ว +154

    This guy remembered his TH-cam password finally

    • @Errichto
      @Errichto  3 ปีที่แล้ว +139

      Come on, once per two weeks isn't that bad!

    • @mariansoltan1318
      @mariansoltan1318 3 ปีที่แล้ว +5

      Not that bad, but you've been doing better before

    • @prakash_77
      @prakash_77 3 ปีที่แล้ว +7

      @@Errichto I fine with it. You're doing great Kamil 🙌🏻

    • @slx0371
      @slx0371 3 ปีที่แล้ว +25

      @@mariansoltan1318 you should be grateful he's taking out of his time to teach us beginners how to do things that are like hello world to him

    • @cocoarecords
      @cocoarecords 3 ปีที่แล้ว +3

      @@slx0371 Yes Errichto is considered to be a saint

  • @avengersassemble6796
    @avengersassemble6796 2 ปีที่แล้ว +16

    To the point, direct and efficient. No BS. Thanks Errichto. After spending countless hours on YT viewing CRT doing ages old methods and bookish stuff, finally I came across a logical solution to it. :)

  • @param4722
    @param4722 3 ปีที่แล้ว +24

    You deserve more subs bro, you explain even better than the professors.

  • @gitlit5489
    @gitlit5489 3 ปีที่แล้ว +17

    i was watching a video that I really want to continue watching but i couldn’t help not clicking on the notification

  • @yashsaxena7787
    @yashsaxena7787 3 ปีที่แล้ว +4

    Although I am not in a college yet but still beside doing Phy/Chem/Maths... I enjoy your videos.. thanks for making things simple for me to understand.

  • @davidharmeyer3093
    @davidharmeyer3093 3 ปีที่แล้ว +5

    Wow, nicely done! This was quite intuitive and easy to understand. Of course you need more for big mods but this is a very helpful intro, and the explanation was super clean!

  • @vlahovivan
    @vlahovivan 3 ปีที่แล้ว +32

    i just found out i independently invented chinese remainder theorem to solve a task for advent of code 2020

    • @عَدِيُّ-م3ح
      @عَدِيُّ-م3ح 3 ปีที่แล้ว +6

      Well done, may Allah guide you and us to the truth.

    • @erenyeager4452
      @erenyeager4452 3 ปีที่แล้ว +6

      @@عَدِيُّ-م3ح wtf??

    • @muneebahmad7729
      @muneebahmad7729 24 วันที่ผ่านมา

      ​@@erenyeager4452 May Allah guide Eren Yeager as well

  • @techwithgantavya6381
    @techwithgantavya6381 3 ปีที่แล้ว +7

    OMG You are such a God I would say you make a full tut series on algorithms

  • @carljohnrivas5525
    @carljohnrivas5525 3 ปีที่แล้ว

    I already watched so many videos about CRT but you only explained how to solve it in 2 mins. Thank you, done subscribing.

  • @abdullahbukhari1469
    @abdullahbukhari1469 3 ปีที่แล้ว +4

    Thank You Bro, I have a DM exam tomorrow, this will save me time

  • @mariusandries4103
    @mariusandries4103 3 ปีที่แล้ว +1

    I didn't knew this; it feels like a game, thanks for sharing and for nice explanations.

  • @youssefsharkawy502
    @youssefsharkawy502 3 ปีที่แล้ว +2

    Man iam big fan from Egypt you my inspiration specially on competitive programming keep going ❤❤

  • @sumitkamble_
    @sumitkamble_ 3 ปีที่แล้ว +2

    Your videos are really helpful
    Hope you will continue uploading more frequently

  • @RexxSchneider
    @RexxSchneider 2 ปีที่แล้ว +1

    It's even quicker if you notice that 3 ≡ -1 (mod 4) and 5 ≡ -1 (mod 6), So x = -1 satisfies the first two congruences. The lcm(4, 6) = 12, so the solution will satisfy x ≡ -1 (mod 12)
    Also if x ≡ 2 (mod 5). then x ≡ 2 or 7 (mod 10). So we're looking for a number that is 1 less than a multiple of 12 and ends in 2 or 7 i.e. find a multiple of 12 that ends in 3 or 8,
    It only takes a moment to spot that 48 is a multiple of 12, and so 48 -1 = 47 will satisfy all three congruences, as will all x ≡ 47 (mod 60) - the lcm(4, 5, 6).
    It shouldn't take 2 minutes.

  • @ryanmoon4283
    @ryanmoon4283 3 ปีที่แล้ว +1

    awesome stuff, way more efficient than what uni taught me

  • @thaegoxakageox8839
    @thaegoxakageox8839 3 ปีที่แล้ว

    Thanks for the video ! You actually are the only ytbers where i have notifications on haha.
    You are amazing !

  • @antiscope2432
    @antiscope2432 3 ปีที่แล้ว +1

    Thank you so much. It's a nice explanation with detail. I enjoyed your content!

  • @ChandraShekhar-by3cd
    @ChandraShekhar-by3cd 3 ปีที่แล้ว

    Thanks a lot for the video Errichto. Hope to see more video in this channel as well.

  • @powapuririn09
    @powapuririn09 9 หลายเดือนก่อน

    man, you literally just save me from failing my term exam

  • @kiral3555
    @kiral3555 3 ปีที่แล้ว +21

    This guy seems good at maths, he should try programming or smth.

  • @andreacodutti1313
    @andreacodutti1313 3 ปีที่แล้ว +5

    7:16 nicee

  • @gauravarora8405
    @gauravarora8405 3 ปีที่แล้ว +1

    Please make a list of important data structures that we need to learn to ace in competitive programming

  • @skyveil
    @skyveil 3 ปีที่แล้ว +2

    I know it might not be important for all but can you please have lower resolutions other than 1080p on your twitch streams. It helps a lot but I have a limited amount of data

  • @mortkebab2849
    @mortkebab2849 3 ปีที่แล้ว +3

    Nearly the end of January and he still has his Christmas hat on. LOL.

    • @nmjverse5806
      @nmjverse5806 3 ปีที่แล้ว

      Trust me, if you don't tell him, he won't change it himself

  • @piyushnaithani7689
    @piyushnaithani7689 3 ปีที่แล้ว +1

    I think there is a necessary condition that every pair of moduli must be coprime, so we can use extended Euclidean

  • @snakebit18
    @snakebit18 3 ปีที่แล้ว +3

    You should start algo and ds series
    Hope you would 👍

  • @GGxEpsilon
    @GGxEpsilon 3 ปีที่แล้ว +3

    A video on fourier transform please :)

  • @maitrayasharma1407
    @maitrayasharma1407 3 ปีที่แล้ว

    MAN U R A GODD MATHEMATICIAN

  • @coefficient1359
    @coefficient1359 3 ปีที่แล้ว

    More of these please

  • @adesuryaramadhan7565
    @adesuryaramadhan7565 3 ปีที่แล้ว

    nice to see ur new video here erichto, we miss u here lmao

  • @PaweSamoraj
    @PaweSamoraj 3 ปีที่แล้ว +1

    I to jest dobry content, bez cpp! :)

  • @ShubhamSingh-gk8vp
    @ShubhamSingh-gk8vp 3 ปีที่แล้ว

    thankyou so much errichto.

  • @sorajk8958
    @sorajk8958 3 ปีที่แล้ว +1

    YOU ARE AWESOME BRO ALSO NICE GUY

  • @KoksMOks
    @KoksMOks 3 ปีที่แล้ว

    that helped me AF thanks budd

  • @theresiapurnama271
    @theresiapurnama271 3 ปีที่แล้ว

    this vid saves my dm exam :')

  • @altairpearl
    @altairpearl 3 ปีที่แล้ว

    Great explanation!!

  • @Name-oi6qd
    @Name-oi6qd 2 ปีที่แล้ว

    thank you very much!!

  • @huska2272
    @huska2272 3 ปีที่แล้ว

    Im proud you are polish.

  • @szyja1233
    @szyja1233 3 ปีที่แล้ว

    nic z tego nie rozumie, ale jestes kozakiem w tym co robisz...

  • @hakuo75
    @hakuo75 ปีที่แล้ว

    고마워요=thank you

  • @PrashantKumar-gg5qd
    @PrashantKumar-gg5qd 3 ปีที่แล้ว

    after so long you have uploaded a video.

  • @vineethkumar8132
    @vineethkumar8132 3 ปีที่แล้ว

    Thanks Erichto!

  • @ani68
    @ani68 3 ปีที่แล้ว +1

    What to do to get a heart from errichto.....🤔🤔

  • @SRPUNCHY
    @SRPUNCHY 3 ปีที่แล้ว

    awsm trick sir ji

  • @KaiAble0601
    @KaiAble0601 3 ปีที่แล้ว

    From Atcoder's contest

  • @rahul.krishna
    @rahul.krishna 3 ปีที่แล้ว

    Errichto, would you consider to make videos on computational geometry !!

  • @saivenkatpendyala2387
    @saivenkatpendyala2387 3 ปีที่แล้ว

    Thanks brother

  • @Szymonides252
    @Szymonides252 3 ปีที่แล้ว +1

    Hi, can you make a video on adaptive huffman coding? I would be very grateful :-)

  • @Neonb88
    @Neonb88 ปีที่แล้ว

    381 is the answer a little bit after timestamp 6:30, I computed it myself

  • @wesleyso0
    @wesleyso0 ปีที่แล้ว

    Nice!

  • @jhhi7223
    @jhhi7223 3 ปีที่แล้ว

    Very good

  • @AIeks1729
    @AIeks1729 3 ปีที่แล้ว

    Thank you

  • @Shiny-et6gb
    @Shiny-et6gb 3 ปีที่แล้ว

    Errichto🤩

  • @quocanhhbui8271
    @quocanhhbui8271 3 ปีที่แล้ว

    Beautiful

  • @07_akashsudan71
    @07_akashsudan71 3 ปีที่แล้ว

    Can you please tells what is the best way for programmers to become good in math.

  • @efrensumortin1474
    @efrensumortin1474 2 ปีที่แล้ว

    What if one of the system is
    X = y mod8 ?? How can we solve that?
    Like X = 2mod12
    X= 8mod30
    X = Cmod20
    How can i get C??

  • @rishabhkumaryadav192
    @rishabhkumaryadav192 3 ปีที่แล้ว

    Irony is that this works drastically slow for large values and we have to switch back to Extended Euclid algo.😀

  • @erikawwad7653
    @erikawwad7653 3 ปีที่แล้ว

    thanks

  • @abhishekdhok5245
    @abhishekdhok5245 3 ปีที่แล้ว +1

    GOD

  • @j.franciscox3318
    @j.franciscox3318 3 ปีที่แล้ว

    What drawing tablet do you use? Thank you.

  • @matjazmeza
    @matjazmeza 2 ปีที่แล้ว

    Only educational videos can get that kind of ratio of likes compared to dislikes.

  • @Theo830
    @Theo830 3 ปีที่แล้ว

    Is it possible to solve this problem faster?

  • @ivayloivanov5766
    @ivayloivanov5766 ปีที่แล้ว

    Can you help me with this, please:
    x ≡ 2 (mod 11)
    x ≡ 9 (mod 15)
    x ≡ 7 (mod 9)
    x ≡ 5 (mod 7) ?

  • @docstyagi7775
    @docstyagi7775 3 ปีที่แล้ว

    please provide amazon link of the chair you've got

  • @CastelGandolfo605
    @CastelGandolfo605 3 ปีที่แล้ว

    Pro Polak programista ;)

  • @Alex-zu4lg
    @Alex-zu4lg 3 ปีที่แล้ว

    Wich program did he use for his presentation?

  • @kantaprasadsinha8025
    @kantaprasadsinha8025 3 ปีที่แล้ว

    Pl read Liber Ulbrict Libberchit . Thirteen Century Chinese Remainder Theorem. What u have done is Brahma gupta ' s theory of 600a d from India. in C R platform. Good Idea. .Merging

  • @gatoradeee
    @gatoradeee 3 ปีที่แล้ว

    How did discover this technique

  • @035asadali8
    @035asadali8 6 หลายเดือนก่อน

    where are you bro i even forget you exist

  • @harshsamoliya1954
    @harshsamoliya1954 3 ปีที่แล้ว +2

    He is teaching us from competitive programming handbook 😅😅😅😅 , i know him very well 🤭🤭🤭

  • @trumm3l243
    @trumm3l243 3 ปีที่แล้ว

    Where are u from man?

  • @jeremiasfigueiredo8399
    @jeremiasfigueiredo8399 3 ปีที่แล้ว

    buenardo

  • @kingmike8469
    @kingmike8469 3 ปีที่แล้ว

    Do you have discord

  • @sumanto_pal
    @sumanto_pal 3 ปีที่แล้ว

    Still waiting for gausian elimination 😶

  • @holyshit922
    @holyshit922 ปีที่แล้ว

    x = 3 (mod 4)
    x = 5 (mod 6)
    x = 2 (mod 5)
    In my opinion it is not good example for the beginning with Chinese Remainder Theorem
    x = 3 (mod 4)
    x = 1 (mod 2)
    x = 2 (mod 3)
    x = 2 (mod 5)
    x = 3 (mod 4)
    x = 2 (mod 3)
    x = 2 (mod 5)
    x = 3 (mod 4)
    x = 2 (mod 15)
    1 = 4*(4)+15*(-1)
    x = (4*4*2 - 15*1*3)(mod 60)
    x = (32-45+60)(mod 60)
    x = 47 (mod 60)

  • @pravinthakur7791
    @pravinthakur7791 3 ปีที่แล้ว

    Needed a competitive coding partner with whom I can start my competitive coding journey .Anyone interested please reply?

  • @rohansharma4065
    @rohansharma4065 3 ปีที่แล้ว

    @Errichto, i need your help friend, can you please make a video on -> how to calculate product of divisors for very very large numbers(represented by prime factorisation). you can refer to problem cses.fi/problemset/task/2182/ which is a newly added problem to cses, thanks :)

    • @MuhammadAlHalabyPlus
      @MuhammadAlHalabyPlus 3 ปีที่แล้ว

      Use the fact that these are multiplicative functions.
      This might help:
      cp-algorithms.com/algebra/divisors.html

  • @soisauce364
    @soisauce364 3 ปีที่แล้ว

    damm

  • @leitedesnatado4555
    @leitedesnatado4555 3 ปีที่แล้ว

    Make more algorithims videos

  • @justaskaulakis8202
    @justaskaulakis8202 3 ปีที่แล้ว

    Sup

  • @thisisneeraj7133
    @thisisneeraj7133 3 ปีที่แล้ว

    You are talking about code many times during video, haven't you tried once actually coding in your life ????

  • @realnight_bot2536
    @realnight_bot2536 2 ปีที่แล้ว

    When and where this algorithm is used ?
    Can anyone help 🥲