Construction of Mealy Machine (Example 1)

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024
  • TOC: Construction of Mealy Machine - Examples (Part 1)
    This lecture shows how to construct a Mealy Machine for a language that accepts all strings over {a,b} that ends with either 'aa' or 'bb'.
    Contribute: www.nesoacademy...
    Website ► www.nesoacademy...
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Pinterest ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    • Axol x Alex Skrindo - ...

Комментарии • 97

  • @ooiidaniioo
    @ooiidaniioo 6 лет назад +26

    The entire playlist is very useful... thank you!

  • @princedivyanshu
    @princedivyanshu 7 лет назад +120

    this is wrong example, it will give output 010 for string aab or bba. 1 is appearing even if the string does not ends with aa or bb.
    This example is correct for the question "if the string contains aa or bb" not ends with.
    Edit :
    turns out, i was wrong, it is correct. The string 010 is ending with zero so it will not accept. It should give output ending with 1 to get accepted.

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 лет назад +39

      He didn't clarify that the input is only "accepted" if the output *ends* with 1. Very ambiguous.

    • @Farahat1234
      @Farahat1234 4 года назад +1

      @@ChristianBurnsShafer means?

    • @Farahat1234
      @Farahat1234 4 года назад +1

      Sochne vali bat to h bhaiya🤔🤔

    • @nirajgaykwad30
      @nirajgaykwad30 4 года назад +3

      you are saying output is 010 , what is wrong then ? ==> Accept the string when right most digit is 1. it's that simple , if right most digit is 0 . This indicates that the string you have entered is not accepted.

    • @RishikavsAnnie
      @RishikavsAnnie 4 года назад +5

      You're right. There shouldn't be self-loops for a/1 and b/1, but 2 different states, hence, the correct machine will have 5 states and not 3. I made the correct one before looking at his solution and got confused, thank you so much for your comment !

  • @zackcarl7861
    @zackcarl7861 2 года назад +14

    I read the comments and saw people not getting the question the question is to have a machine that accepts strings taht have aa/bb at the end , is a string like aaba can't be accepted , but a string like aa, bb, aabb, abaa ,etc are accepted , and that's all the machine does so if you getting out put as 010 ,well your string of inputs is wrong(not accepted) why because 1 only represent , the completion of a sequence aa/bb in the string , so yes you can get a string like aab and you will have out put like 010 but that shows you the string is not ending with bb or aa and also tells that ther is one pair is aa or bb in the strong

  • @apostolosmavropoulos177
    @apostolosmavropoulos177 4 года назад +30

    Neso u Must clarify this example if u respect your subscribers! This example seems wrong.. like others have mentioned in the comment section.. is it ok(safe?) to assume that whenever we encounter aa or bb in a string we have output 1? instead of accepting strings that end with aa or bb its more like pointing out how many ''aa' ' or/and ''bb'' an input string has *( if we add the '1' s in the ouput sequence)

    • @apostolosmavropoulos177
      @apostolosmavropoulos177 4 года назад

      I think i'm right guys this is the correct question (video 38) Conversion of Mealy Machine to Moore Machine (Example 1) ruclips.net/video/rkgbhngdJ5Y/видео.html

    • @azif1858
      @azif1858 4 года назад

      Yes this is wrong

    • @zackcarl7861
      @zackcarl7861 2 года назад +3

      So what the problem i mean yes you can count how many aa or bb ate in the string if you can multiple of them ,but the question is not how may aa/bb are there the question is , it (machine ) must accept any string ending with aa/bb it could be aabaa aaabb , aa ,bb

  • @andythomson2227
    @andythomson2227 3 года назад +10

    never stop neso....lots of love

  • @shubhamsawlani2933
    @shubhamsawlani2933 5 лет назад +2

    East or west Neso Academy is the best.

  • @shivendrayadav3991
    @shivendrayadav3991 6 лет назад +11

    Sir,
    How do you determined that it will give output 1 for aa and bb.I am getting confused.
    Can you explain it.

  • @ujjwaldixit4244
    @ujjwaldixit4244 3 года назад

    I have another solution starting state A on getting input a gives output(0) and goes to state B, A on getting input b gives output(0) and goes to state D, B on getting input a gives output(1) and goes to state C, B on getting input b goes to state D and gives ouput(0), D on getting input b goes to state E and gives output(1), D on getting input a goes to state B and produce output(0).
    Correct me if i am wrong.

  • @10_yogeshchandrapandey90
    @10_yogeshchandrapandey90 4 года назад +3

    There must be a condition for producing such mealy machine, and that is :-
    Condition -- Machine only accept those strings for which, MSB in output string is 1, else it is considered as not accepting the input strings.

  • @agnijusbotyrius4317
    @agnijusbotyrius4317 2 года назад +4

    If the output must also meet the criteria of the 1 being at the end. Doesn't it mean that we should create another FSM like DSA to determine whether the output is correct? Meaning that we need two FSM's in total?

    • @shubhamjaiswal6748
      @shubhamjaiswal6748 2 года назад

      That is what i was thinking. Mealy machine generates the string corresponding to the input string and then we use another FSM to check whether the output string is accepted or not. If it gets accepted then the original string ends with aa or bb.

  • @NagajothiC-qu7ch
    @NagajothiC-qu7ch 2 года назад +2

    Very useful..thanks a lot

  • @verma127
    @verma127 3 года назад +2

    Wrong solution, as it will produce 1 when ever the sequence aa or bb appears in input. while the question says output 1 only when aa or bb appears in end only.

    • @shubhamjaiswal6748
      @shubhamjaiswal6748 2 года назад

      Sir Mealy machine will only generate the output string consisting of 0 and 1. We need to create another machine to check the acceptance of the o/p string. If the output string gets accepted then the original input string ends with aa or bb and if not then the input string does not end with aa or bb.

  • @shivamsinghal8657
    @shivamsinghal8657 2 года назад +2

    It seems that either the question is something different or your machine is wrong. Please check it and explain if I am wrong.

    • @pycoder7652
      @pycoder7652 2 года назад

      I am really late but still, our aim here is just to create a mealy machine that will accept a string if it ends with aa or bb.the strings can be aaabb, baa,aaaabb etc

  • @jayalakshmi4849
    @jayalakshmi4849 7 лет назад +15

    In the previous video titled 'Construction of Mealy machine', the question was to print 'a' whenever sequence 01 is encountered or print 'b' otherwise. So in that video when 0 occurred the flow went from state A to state B with output b and when again 1 occurred in the input i.e. when we got the desired sequence the flow went from state B to state C with the output 'a'.But in this video when aa was detected the flow remained on state B itself outputting a 1 (similarly for state C when bb is detected) instead of going to another state like it was done in the previous video. Please explain.

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 лет назад +6

      Note that string 'aaa' has the string 'aa' occuring in it twice. Once for the first two a's and once for the last two a's. If we move away after counting the first, then we won't count the second. In particular input 'aaa' returns output '011' which we accept.

    • @AyushEditz-hs6pf
      @AyushEditz-hs6pf Год назад +1

      @@ChristianBurnsShafer this would count the number of occurrences of aa and bb but in the question it is asking for ending with aa and bb

    • @ChristianBurnsShafer
      @ChristianBurnsShafer Год назад +1

      @@AyushEditz-hs6pf Oh shit good call. There would be the first aa, second aa, and aaa, e.g.

  • @kainaatmakhani6550
    @kainaatmakhani6550 2 года назад

    nice lecture

  • @malaimama
    @malaimama 7 лет назад +19

    this example is wrong it will print 1 whenever it encounters with aa or bb. not when a string ends with aa or bb. make a dfa which accepts strings ending with aa and bb and then assign 1.

    • @ajaykundu5179
      @ajaykundu5179 7 лет назад +3

      thanks a lot sir for clearing the doubt.

    • @ajaykundu5179
      @ajaykundu5179 7 лет назад +1

      you are doing a very nice work.

    • @arpitkumar4525
      @arpitkumar4525 6 лет назад +1

      Neso Academy Nice.

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 лет назад +6

      +Neso Academy Your use of the term "accepted" is what's causing the problems here. You should simply state "the output will end in 1 if the input ends in aa or bb" if that's what you mean.

    • @REFIREGAMING
      @REFIREGAMING 7 месяцев назад +2

      Dfa has a final state, melay and moore doesnt… fundamental flaw in your concept

  • @AadeshingaleOfficial-zl5fd
    @AadeshingaleOfficial-zl5fd Месяц назад

    Nice Sir 😊

  • @crazyeye1213
    @crazyeye1213 7 лет назад +35

    what about input aab aur bba string?
    it print 1 but not ended with aa or bb.

    • @glmstar
      @glmstar 6 лет назад +4

      aa takes to state B with output =1 ; Now if in that state you apply another input b then you move to state C. the output =0 because the sequence is a-->a output =1 when you enter b it transitions from a-->b output =0. Guess it helps

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 лет назад +13

      He didn't clarify that the input is only "accepted" if the output *ends* with 1. Very ambiguous.

    • @TheTechnicalman
      @TheTechnicalman 6 лет назад +5

      A Mealy machine does not have final states because it does not accept or reject input. Instead each transition produces output.

    • @priyajitbera2429
      @priyajitbera2429 5 лет назад +4

      The output string has to end with 1 only.

    • @jibranattar6519
      @jibranattar6519 Месяц назад

      bba mat akr no scope

  • @NAFEES-d4g
    @NAFEES-d4g 3 месяца назад

    Design a mealy machine that scans sequence of input of 0 and 1 and generates output 'A' if
    the input string terminates in 00, output 'B' if the string terminates in 11, and output 'C'
    otherwise. Solve this One problem

  • @omkarsuralkar8099
    @omkarsuralkar8099 2 года назад

    Thank You💙

  • @umangkumar2005
    @umangkumar2005 2 года назад

    the solution you gave
    it accept the string which contain aa or bb in anywhere of the string
    please give right answer

  • @ebhabakhla7800
    @ebhabakhla7800 4 года назад +1

    Thankyou sooo much sir...for explanation 👍👍

  • @c.m.8146
    @c.m.8146 6 лет назад +2

    i love NESO

  • @ebalona5828
    @ebalona5828 5 месяцев назад

    What about aaabbb, the output will be 011011, i think it needs clarification should it count all aa or just paired aa

  • @theclicks5804
    @theclicks5804 3 года назад +1

    If I give input as aaa it prints 011 so here aaa is accepted

  • @itzdhotiop3945
    @itzdhotiop3945 Год назад

    You should mention the final state

  • @dasariraviteja7835
    @dasariraviteja7835 4 года назад +1

    sir how u take the output aa =1 and bb=1? getting confused sir!

  • @annanyamathur8869
    @annanyamathur8869 3 года назад

    for string abba also it is showing 1 , but that's not correct , as it should end with aa or bb

  • @jugendra11
    @jugendra11 4 месяца назад

    if we give input as aab or bba it still gives 1 which means something is wrong.

  • @nikhielsingh748
    @nikhielsingh748 2 года назад +1

    Great video , but the example is incorrect - aaa will produce 1,1 which is wrong as 1,1 should be produced when aaaa is inputed

  • @591ganesh4
    @591ganesh4 2 года назад

    Insted of taking 2 stages and placing a self loop in 2nd stage why don’t we take 3 stage’s A->B->C

  • @tapanmahata8330
    @tapanmahata8330 4 года назад +1

    It is a bit confusing.the question should be "the string contain aa or bb" not end with aa or bb.

    • @aisakyunhotahai8130
      @aisakyunhotahai8130 4 года назад +1

      It's correct question, the thing is we have to focus only on the last output bit obtained

  • @ronitroy1391
    @ronitroy1391 3 года назад

    is final state not necessary in mealy machine ? as in this example no final stae is there though strings ends with either aa or bb

  • @bansishah2091
    @bansishah2091 Год назад +1

    so, if the input is aaa, will the output be 011 ? is that right ?

    • @akashhuyaar
      @akashhuyaar Год назад

      yes but it seems confusing, don't know if that was the expected behaviour or not

  • @educationofeverythingcomeu1960
    @educationofeverythingcomeu1960 5 лет назад

    Could you please an example of drawing a waveform timing diagram from a state diagram of a mealy machine

  • @unclemoolala
    @unclemoolala Год назад

    Why are there no final state(s) in the machine?

  • @poojakothule8359
    @poojakothule8359 6 лет назад +1

    Tysm sir....

  • @100sabh
    @100sabh 4 года назад

    Sorry Sir , but the DFA is incorrect.. This DFA counts the number of occurrences of either a or b...

    • @sent4444
      @sent4444 4 года назад +2

      Sorry Sir , but this is Mealy Machine.. not DFA...

  • @tarunvishwakarma96
    @tarunvishwakarma96 5 лет назад

    How to design a mealy machine that increment binary number by 1?

  • @anjalikckc3843
    @anjalikckc3843 6 лет назад

    String from sigma* means??

  • @parthibroy7688
    @parthibroy7688 Год назад

    If we give input as abbaa, we get output as 00101, is it okay?

    • @pagal4621
      @pagal4621 11 месяцев назад

      👍👍

    • @mohandinkar75
      @mohandinkar75 Месяц назад

      String must end with aa / bb . If you get the 1 at the last the string will be acceptable otherwise not. Appearance of 1 in middle doesn't matter at all.

  • @vaibhavkhandelwal4031
    @vaibhavkhandelwal4031 6 лет назад

    check for string 'aaa' it will produce output '011' . Isn't it wrong?

    • @ChristianBurnsShafer
      @ChristianBurnsShafer 6 лет назад +4

      String 'aaa' ends in 'aa' and output '011' ends in 1, which is the intended way for this machine to work.

  • @zackmercurys
    @zackmercurys 5 лет назад +1

    where did the final state go in these examples?

    • @nilshrestha9147
      @nilshrestha9147 5 лет назад +1

      There is no initial and final state in mealy machine

    • @zackmercurys
      @zackmercurys 5 лет назад +1

      @@nilshrestha9147 why is that?

    • @nilshrestha9147
      @nilshrestha9147 5 лет назад +1

      Because it doesn't reject the input like in DFA, it means that it gives some output for every input...

    • @tapanmahata8330
      @tapanmahata8330 4 года назад

      No .mealy meachine has initial stage but not has final stage.

  • @anvithvattikuti1727
    @anvithvattikuti1727 2 года назад +1

    A day before exam in 2x speed

  • @kshitijgarg9961
    @kshitijgarg9961 6 лет назад

    what about AAABBB?

    • @backslash8874
      @backslash8874 5 лет назад +3

      Yes, it would accept...we are concerned about the last output of the machine(it would accept only if the last output is 1)...since the ending state is BB, so the last output is 1 and thus it accepts...

  • @neiljohn2637
    @neiljohn2637 3 года назад

    29

  • @palakgupta7237
    @palakgupta7237 7 лет назад +1

    What if they string is babbb ?

  • @aayushagrawal8371
    @aayushagrawal8371 4 года назад

    A bit confusing but ok

  • @preparingengineering
    @preparingengineering Год назад

    ok