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 :)
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
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?
+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.
@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??
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.
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
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
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 :)
thanks a lot bro, i was struggling for a long time with this.
Thank you!
Thnx
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
These are some nice lectures
"I get a machine that doesn't make any sense... and it's wrong!" Excellent quote :P Great vids, thanks for sharing
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?
+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.
excellent video...
what do you mean by "double the length " ?
I noticed 5:03 does not have a final state.
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
excellent teacher, and his name is?
Im seriously impressed that he knows all the students names
@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??
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.
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
I can't understand how he divided the binary number. Can someone please explain this?
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
An excellent prof. but I bet his exams are VERY hard.