Regular Languages

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024
  • TOC: Regular Languages in Theory of Computation.
    Topics Discussed:
    1. Regular Languages in TOC.
    2. Non-Regular Languages in TOC.
    3. Examples of languages which are not regular.
    Full Course on TOC: goo.gl/f4CmJw
    Follow Neso Academy on Instagram: @nesoacademy (bit.ly/2XP63OE)
    Follow me on Instagram: @jaiz_itech (bit.ly/2M3xyOa)
    Contribute: www.nesoacademy...
    Memberships: bit.ly/2U7YSPI
    Books: www.nesoacademy...
    Website ► www.nesoacademy...
    Forum ► forum.nesoacad...
    Facebook ► goo.gl/Nt0PmB
    Twitter ► / nesoacademy
    Music:
    Axol x Alex Skrindo - You [NCS Release]
    #TheoryOfComputation #TOCByNeso #RegularLanguages #AutomataTheory

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

  • @BossLikesShenanigans
    @BossLikesShenanigans 7 ปีที่แล้ว +30

    Why is the first example not a regular language? If the language just consists of one string then can't you just have all the states of the machine be Q ={a, ab, abb...} and then the transition function for each state would be whether the next symbol is seen, and if it isn't, we send the machine to a dead state?
    EDIT: I just saw your reply to a different comment. I didn't understand the example. For those wondering the example was about whether it can detect if a string repeated itself.

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

    the first example can be modelled in a FSM. First u make a tree structured DFM with 'a' for left and 'b' for right. then wherever u end up at the fifth character, u continue accordingly.

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

      Exactly!

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

      U could also make an NFA ith an epsilon transition back to the start after reading ababb

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

      Yeah I also found that :( It really confused me

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

      i think this is true only if the alphabet is equal to {a,b}. if the alphabet includes more symbols your solution would be wrong

    • @Amy-mo9ki
      @Amy-mo9ki ปีที่แล้ว +1

      yes

  • @hectorg362
    @hectorg362 5 ปีที่แล้ว +18

    I freaken love you and this channel for this content!

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

    To be clear.
    Let S to be a string. We could have DFA to recognize S* just simply by loop to the beginning after a full match. What Neso mean is just that we could not have a DFA to find a arbitrary S's repetition. To recognize a specific string's repetition is a different story with arbitrary string's repetition!!!

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

      if ababb needs to be repeated exactly n times then we increase the number of states (copy the FM n times) wouldn't that work?
      ((A))-a->((B))-b->((C))-a->((D))-b->((E))-b->(((F))) - - a - -> ((B)) - -
      NFA for any non-integer repetition.
      (A)-a->(B)-b->(C)-a->(D)-b->(E)-b->(F)- - a - ->(B2)-b->(C2)-a->(D2)-b->(E2)-b->((F2))
      NFA for exactly 2 repetitions.

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

      ​@@whiteheadiceprince1506 This string you mean "ababa" is a specific one. You can have DFA for this specific string for any repetition of times.
      But the DFA you constructed for "ababa" may not work for other string like "abcabc".
      What Neso mean is you can not have DFA works for all types of string with repetitions.

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

      @@zerobit778 ohh ok thank you

  • @Bananainacar
    @Bananainacar 2 ปีที่แล้ว +15

    Wonderful video! Everything is explained in such a clear and efficient way. You're the best.

  • @nguyentuananhphan8644
    @nguyentuananhphan8644 6 หลายเดือนก่อน +1

    Thank you sir for your clear explanation, this series really saves me!!! God bless you!

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

    Thanks

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

    Amazing content.Keep up the good work.

  • @pailguy7157
    @pailguy7157 4 ปีที่แล้ว +85

    The first Eg. (ababbababb) repeats only 2 times, so without saving it we can simply construct a DFA that gets all inputs as a sequence of alphabets. In this case isn't it regular language?

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

      Pail guy and Calvin, you're both correct

    • @tapajkumardas9973
      @tapajkumardas9973 4 ปีที่แล้ว +57

      If the repeating part of the string is of finite length, I think we can construct DFA for it.
      I think what he meant to say is that, we can't construct a DFA that accepts all strings that are arbitrary repetition of a smaller string.

    • @rohandesai4585
      @rohandesai4585 4 ปีที่แล้ว +6

      But can't we construct a DFA for any number of ababb substring to occur?

    • @georgiosargyris3073
      @georgiosargyris3073 4 ปีที่แล้ว +6

      For the first example (ababb)* is a regular expression that generates the string of the first example. Since there is a regular expression, there is also a finite machine. Instead, my language accepts even when ababb is repeated n times (n greater or equal to 0). Maybe, the guy on video implies what Tapaj says.

    • @Rohith_E
      @Rohith_E 4 ปีที่แล้ว +8

      The rule for language 1 is: 'The first n Symbols repeat once'. These n symbols can be anything. Just as an example he mentioned ababb.

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

    i like your lectures , brother. you got one more subscriber.

  • @ijazkhans5521
    @ijazkhans5521 6 หลายเดือนก่อน +2

    The expression ( ababbababb ) that you discussed earlier in this lecture is regular expression and you say: it's not a regular

  • @Oneminutecover-dx8re
    @Oneminutecover-dx8re 6 หลายเดือนก่อน +2

    Don't get how FSM can't store strings when in the previous lectures of DSM we transfer all string to next state(or that's how I understood it )

  • @KiimzB
    @KiimzB 5 ปีที่แล้ว +10

    This was such a good video. Very clear. Thank you

  • @deadoralivecowboy1401
    @deadoralivecowboy1401 4 ปีที่แล้ว +30

    Please make a video of the proof of the first theorem you wrote !! I have an exam in two days , I know it is too late for me but for other generations maybe not so late :)

    • @nameless2850
      @nameless2850 2 ปีที่แล้ว +7

      Lol too late... Have exam tomarrow

    • @deadoralivecowboy1401
      @deadoralivecowboy1401 2 ปีที่แล้ว +5

      @@nameless2850 every cs video's fate I guess...
      Good luck ,man !!

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

      @@deadoralivecowboy1401 and now my fate🥲

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

      @@abhisheknegi2888 Now mine

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

      My time has come… I have exam in 3 days 😅

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

    I'm missing the explaination why finite state automata cannot count or store strings. Maybe an example where we try to build a fsm that tries process these langages but fails would have been useful.

    • @Nano-ih3ig
      @Nano-ih3ig 3 ปีที่แล้ว +1

      It doesn't store any previous input of the string that has been provided. You only move forward with the current input. For eg. if w is a string with symbol {a, b} so to recognize ww, you need to store w first, which is not possible in FSM.

  • @hassanhashemi6478
    @hassanhashemi6478 6 ปีที่แล้ว +4

    i love they way you explain things.

  • @MaxAndHisBike
    @MaxAndHisBike 5 ปีที่แล้ว +10

    Theoretically you could build a state Machine which recognizes the second language, as long as you can build a machine with 2*n-states

  • @miro-hristov
    @miro-hristov 3 ปีที่แล้ว +2

    You said that a language is regular if it can be recognized by FSM. RegEx has a lot of modifiers that allow it to count repetition or use memory. Eg. "{2}" is a quantifier - Match 2 of the preceding token. Or "\1" is Backreference - matches the result of capture group #1. Does that make Regular Expressions not a regular language? I'm a little confused...

  • @Alkis05
    @Alkis05 2 ปีที่แล้ว +4

    A video of what is regular language that shows examples only of non-regular languages. Don't you think it would be a good idea to illustrate that regular language is?

  • @nirmalasanapthi7548
    @nirmalasanapthi7548 6 ปีที่แล้ว +9

    Respected sir
    By using 6 states + 1 dead state we can construct a dfa for ababbababb

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

      Your dfa only accepts ababbababb but it should accept any ww where w is a string thats why we cant use dfa

    • @kasozivincent107
      @kasozivincent107 4 ปีที่แล้ว

      I doubt if 6 suffices, we need 10 + 1 dead state.

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

    By the way is a language over {a,b} that contains aabb in itself regular or not

  • @shivrajkhose7875
    @shivrajkhose7875 7 ปีที่แล้ว +2

    very helpful

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

    Thankyou sir

  • @azeemqureshi4963
    @azeemqureshi4963 4 ปีที่แล้ว

    wow what a nice video you made very clear and very easy...

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

    can you explain that why ababbababb is not recognizing with FSM ? i can create ababbababb by using 10 state(one state point to dead conditions) simply.

    • @gamereplayhq
      @gamereplayhq 6 ปีที่แล้ว +7

      Yes, although you can make it, the question here is, suppose you want user to just input "ababb" and insert rest of the values yourself to generate the result, such action would be possible if we have some sort of memory from which we could retrieve the values and use them as input to run our machine further on its own without user intervention, however in FSM, user must give some input to move states, there is no dedicated memory bank that could provide input to machine.

  • @naseerrahi7597
    @naseerrahi7597 5 ปีที่แล้ว +2

    What r various models to represent regular language

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

    Thank You

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

    Totally helpful

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

    What if you define the language in the first example as follows:
    L = {V, S, T, P}
    where,
    V = {a, b, S, A}
    T = {a, b}
    P = {S->Ab, A->AbAb, A->abab}
    Would that not make the example a regular language, unlike the second one in which a memory of N is required?

    • @matamorosa
      @matamorosa 4 ปีที่แล้ว

      yeah I also don't think his first example is valid

  • @arturo7392
    @arturo7392 5 ปีที่แล้ว +14

    you forgot to put an example of a regular language... almost a perfect video

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

      all the 4 examples before are regular languages, yall lazy.

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

    why is second one not a regular language in when in previous video we designed a dfa fo aabb which follows the structure aNbN n=2?

    • @niburX
      @niburX 5 หลายเดือนก่อน

      I think it's because in this video, it's not only n=2, but for all natural numbers (i.e.: n≥1).

  • @_BE-A_SaurabhNehe
    @_BE-A_SaurabhNehe 3 ปีที่แล้ว

    Thanks alot sir

  • @manasuniyal4250
    @manasuniyal4250 5 ปีที่แล้ว +1

    The first language is regular as it can be represented L={(ababb)^n : n>=1), provided lambda is not accepted, for which a DFA can be constructed.

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

    I don't understand practically about regular expression i just understand the theory.

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

    The degree of complexity and the way of performing the functions
    characteristic. Automatic Grade 1

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

    if Σ=(0,1) then describe Σ* 1Σ*
    Answer pls?

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

    Regular Language -> if some FSM recogonizes it.
    FSM -> Very low memory.

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb 3 ปีที่แล้ว

    Thank you..

  • @LorenzoLeonardini
    @LorenzoLeonardini 4 ปีที่แล้ว +1

    Actually ababbababb is a regular language
    If the language is just that you can have a simple machine which recognizes the string.
    If the language is "ababb" repeated n times you can still have a machine which recognizes it: just 5 states to recognize the basic string, only the last state is a final state and if you are in the final state and read an "a" you start over from the first state

    • @purveshdubey7562
      @purveshdubey7562 4 ปีที่แล้ว

      I also think so, we can easily construct nfa for that

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

      It is not asking if you can check if the string "ababb" is repeating.
      It is asking us to check if we need to memorize an arbitrary string. Our Finite Acceptors can only remember a singular state so it would require an infinite amount of nodes to remember every possible arbitrary string.

  • @logiclassan7115
    @logiclassan7115 6 ปีที่แล้ว +141

    set the speed to 2x

    • @fupopanda
      @fupopanda 5 ปีที่แล้ว +16

      It's good that he goes slow, allowing you to speed the video up when you need to, and leave it as it is when necessary as well.

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

      Why?????????

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

    more formal way to define a regular language would be that it can be described by a regular expression.

  • @vikaspanthi663
    @vikaspanthi663 5 ปีที่แล้ว

    Awesome video...

  • @sparshsondhi1424
    @sparshsondhi1424 5 ปีที่แล้ว +2

    Respected Sir
    In the second example, can we not make a DFA with an infinite number (limited only by total memory available) of states in a line, each moving forward on input A and back on input B? That way we can keep our initial and final state the same and still have a way to count the number of A's and b's.

    • @eeshaan1539
      @eeshaan1539 5 ปีที่แล้ว

      it shouldn't be of the form ababab, but should be aaaa....bbbb....

    • @sparshsondhi1424
      @sparshsondhi1424 5 ปีที่แล้ว

      @@eeshaan1539 Agreed, but what trying to imply is making a ladder.... Ababab strings would never reach the initial/final (because they're the same) state without having an equal number of A's and b's... Imagine going up 3 steps and coming down 3 steps as an analogy

    • @sparshsondhi1424
      @sparshsondhi1424 5 ปีที่แล้ว

      Now that I think about it.... This is quite impractical. A DFA needs full information about all states and I can't define how the start and end states would be structured

  • @limishavyas2496
    @limishavyas2496 7 ปีที่แล้ว +1

    costruct regular grammer for language is avalible or not......?

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb 3 ปีที่แล้ว

    THANKS..

  • @ManpreetSingh-pn2hu
    @ManpreetSingh-pn2hu ปีที่แล้ว

    watching all the videos one day before the exam on 2x

  • @M-ABDULLAH-AZIZ
    @M-ABDULLAH-AZIZ 5 ปีที่แล้ว +3

    Is this language {(0^n)(1^m)|(n+m)is even} regular or not?

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

      Is not regular because you need to count n and m to know that the sum is even.

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

      @@raulcalvomartin2979 No, it is regular! Checking whether n+m is even does not require you to remember n and m completely, it is enough to remember the remainder modulo 2, which can be done with finitely many states.

  • @studentstudent1237
    @studentstudent1237 4 ปีที่แล้ว +1

    Thank you Sir for explaining this ,is regular language same as regular expression?

  • @hygieia5672
    @hygieia5672 10 หลายเดือนก่อน

    Good but spoiled a bit by specifying five letters specifically and not N letters. With five (or some other constant) letters the language is finite and you can construct a DFA for it, it is regular. If it is some arbitrary number of letters than you cannot.

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

    And what if its a language that start with a and finish with b ?

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

    List some examples of regular language's

  • @1234Christodoulos
    @1234Christodoulos 2 ปีที่แล้ว

    how do we know how to split the "aaaaaaabbbbbb" into x y z ? is it just random

  • @cvismenu
    @cvismenu 6 ปีที่แล้ว +1

    Awesome

  • @jainlokesh318
    @jainlokesh318 5 ปีที่แล้ว

    amazing

  • @nabhavlogs371
    @nabhavlogs371 5 ปีที่แล้ว

    example 1 is a string, not language,which we can represent using DFA

    • @ziliestarrive
      @ziliestarrive 5 ปีที่แล้ว

      It's for recognizing M1M2, where M1 is a string and M1=M2, that's the rule for the language.

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

    finally found a good video, jesus...

  • @ravikumarpal662
    @ravikumarpal662 5 ปีที่แล้ว +13

    speed of 1.5 is sufficient for beginners

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

    my teacher plays your videos in lectures

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

    Can u provide ur class notes

  • @zahidqureshi8128
    @zahidqureshi8128 5 ปีที่แล้ว +2

    sorry sir, but first example is incorrect ...if L is regular and L^2 is also regular ...refrence introduction to FLA edition 5th by peter linz Fig 2.7 page 46

    • @peymanmohsenikiasari8564
      @peymanmohsenikiasari8564 5 ปีที่แล้ว +2

      I think he meant to find strings that are in the form of XX (that X could be any string), which is impossible to be found by a finite state machine.

  • @apporvaarya
    @apporvaarya 4 ปีที่แล้ว

    didn't get much idea

  • @danielnunes3598
    @danielnunes3598 5 ปีที่แล้ว

    fix the audio, please

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

    8 like Shaun Tait!

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

    But provided that language is finite,it will be regular....please mention it

  • @bdjeosjfjdskskkdjdnfbdj
    @bdjeosjfjdskskkdjdnfbdj 4 ปีที่แล้ว

    is there a proof for repetition --> non regular? seems like a bit of a leap for me!

  • @himalatalukdar5597
    @himalatalukdar5597 6 ปีที่แล้ว

    Is this lecture value for gate and other competitive exams?

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

      this lecture is very fruitful for concept on regular language. a good concept can only make one solve questions

  • @gabrielpereiramendes3463
    @gabrielpereiramendes3463 5 ปีที่แล้ว

    #Excelent!

  • @saikishan1000
    @saikishan1000 6 ปีที่แล้ว +4

    lol I have final exam next week let's see if ness will make me pass

    • @sunnynavani5314
      @sunnynavani5314 6 ปีที่แล้ว

      now i have final exam next week so can you tell that are you pass or fail? :D :P

    • @tallle2
      @tallle2 6 ปีที่แล้ว

      what happened?

    • @HafizMohammede
      @HafizMohammede 4 ปีที่แล้ว

      I hav xam nxt morning and found this video only now time :12:45am

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

    video bht achi h but urdu me hoti to or be achi hoti

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

    「どうやってやるの?」、

  • @DolaLado
    @DolaLado 5 ปีที่แล้ว

    I didn't understand the first example. ababbababb. I think we can design a DFA for it.

    • @eeshaan1539
      @eeshaan1539 5 ปีที่แล้ว +1

      The language is { ww : w is a string over Sigma} i.e. the first and second halves of the string must be same. ababbababb is one of the strings in this language, but it's not the only one.

  • @yamankaithwas5016
    @yamankaithwas5016 14 วันที่ผ่านมา

    NOTES
    ?????????????????????????????????? NOTES

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

    1.75x,, you are welcome

  • @nitinjain1325
    @nitinjain1325 6 ปีที่แล้ว +1

    kaisa machine hai jo ek count ko bhi store nahi kar sakta hai

    • @naruto07959
      @naruto07959 6 ปีที่แล้ว +1

      yeah, right. Just like you dumbass XD

    • @norhaking
      @norhaking 6 ปีที่แล้ว +1

      lol

  • @vinayaksharma-ys3ip
    @vinayaksharma-ys3ip 3 ปีที่แล้ว

    👍👍👍

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

    Any KECian😂

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

    Any vitian😅

  • @shakarwshyar2980
    @shakarwshyar2980 10 หลายเดือนก่อน

    Thanks

  • @naavedali7303
    @naavedali7303 6 ปีที่แล้ว +1

    thank you sir