Lecture 1 - Finite State Machines (Part 5/9)

Поділитися
Вставка
  • Опубліковано 7 січ 2025

КОМЕНТАРІ • 21

  • @amartya777
    @amartya777 7 років тому +26

    For all those struggling to understand the algorithm he used to to solve the division by 3 problem. It's pretty simple and you don't need to know modular arithmetic or any other discrete maths concept to understand it.
    First of all let's go back to the basic division by 3 in decimal number system. Whenever we divide a number by 3, we get either 0, 1 or 2 as a remainder, so we can say for any natural number N, remainder(N/3) ϵ {0,1,2} ;
    Now, we have a binary string 10111 and we are reading it from left to right.
    So first, we read the symbol 1 and then divide it by 3 ; 1/3 gives a remainder of 1.
    Next, we are adding a 0 next to the previous 1 as we progress through the string. So now the string is 10.
    Now notice the string becomes double as we add a zero at the end of it.
    10 ( = 2) is double of 1.
    100 ( = 4 ) is double of 2.
    1000 ( = 8 ) is double of 4 and so on. Simple binary arithmetic.
    Now, let's do the division. What he is saying here is when we are doubling the string, we are also doubling it's remainder(he didn't prove it here, but we can see it just by some examples ourselves).
    1 ÷ 3 -----> 1
    10(2, the number is doubled) ÷ 3 -----> 2 (the remainder is also doubled )
    100 (4, the number is doubled) ÷ 3 -------> 4 (the remainder is also doubled) [now 4 is also divisible by 3 and leaves a remainder of 1] ----> 1
    101(5, adding 1) ÷ 3 ------> 2 adding a 1 to 100 also adds a 1 to the remainder.
    1010 (10 : see after adding a 0 the string doubles it again from 5 to 10) ÷ 3 ----> 4 ----> 1
    1011(11) ÷ 3 ----> 2
    10110(22) ÷ 3 ----> 4 ----> 1
    10111(23) ÷ 3 -----> 2
    Hence the remainder is 2.
    Hope it helped :)

  • @mirandadolan5727
    @mirandadolan5727 5 років тому

    Taking this class at a different university and quite a fews later than when these videos were originally posted, and this guy is AMAZING! Wish I could have him as my professor

  • @GuillermoValleCosmos
    @GuillermoValleCosmos 9 років тому +1

    These are some nice lectures

  • @onlysamurai
    @onlysamurai 13 років тому

    "I get a machine that doesn't make any sense... and it's wrong!" Excellent quote :P Great vids, thanks for sharing

  • @adityaakshay1
    @adityaakshay1 10 років тому +1

    WoodenGravel yes that seems right!!! wat you have said. Also with the dead state I am not sure. The question is 1 followed by 2 zeros so why cant we have on 1 in third state going to second and 1 remaining in the first state itself on a 1??? Is it that the machine should terminate on seeing a 1 followed for 1 or is it that machine should check a pattern for 100?

    • @mahathirahmad7662
      @mahathirahmad7662 8 років тому

      +akshay padmanabhan Read the question. It said, "all binary strings which have 1's followed by two 0's" , meaning, for all 1's in string, they must be immediately followed by 2 0's.

  • @kush-909
    @kush-909 11 років тому

    excellent video...
    what do you mean by "double the length " ?

  • @nicholaskong1673
    @nicholaskong1673 2 роки тому

    I noticed 5:03 does not have a final state.

  • @WoodenGravel
    @WoodenGravel 11 років тому

    When he minimizes the states shouldnt the arrow going to initial state be 1 and going to 2nd state and the 0 arrow to itself? @4:59

  • @37no37
    @37no37 2 роки тому

    excellent teacher, and his name is?

  • @dlapp14
    @dlapp14 12 років тому

    Im seriously impressed that he knows all the students names

  • @adityaakshay1
    @adityaakshay1 10 років тому +1

    @4.59 he says the last state 0 should go to the first state in minimisation which is wrong i beleive u are then making the initial state the final state which means even a single zero will get accepted...
    Please can some one confirm this??

    • @hyphenpointhyphen
      @hyphenpointhyphen 8 років тому

      Yep - came to look for this kind of comment.
      You're right, he was too fast i'd guess - the last state must be an extra final state bc. else it would accept the empty string which is obv. wrong.

    • @nikolassiciliano6483
      @nikolassiciliano6483 6 років тому

      it would have two final states, the start state would be accept a string of all zeros in addition to strings following the rule, and the second zero state would accept strings ending in 100

  • @jasminemirabueno2527
    @jasminemirabueno2527 10 років тому

    I can't understand how he divided the binary number. Can someone please explain this?

  • @mihaigeorgeadrian
    @mihaigeorgeadrian 8 років тому

    what is going on at 7:30
    we divide binary 1(decimal 1) by 3... and the result is 0 and reminder 1
    we divide binary 10(decimal 2) by 3... and the result is something and reminder 2..... I don't get it
    somebody...please take me out of this intelectual shit

  • @mazz1999888
    @mazz1999888 13 років тому

    An excellent prof. but I bet his exams are VERY hard.