Generating CFG from regular expression | context free grammar | RE to CFG | CFG from RE | cfg to re

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ต.ค. 2024
  • Generating Context free grammar from any given regular expression is very important. So we will see multiple solved examples here that will help you in theory of computation as well as compiler design. In this video, we'll see the examples of how to generate CFG (Context Free Grammar) from the given regular expression in TOC (Theory of computation) #cfg #regularExpression #toc #cse #cseconceptwithparinita
    If you like my video contents, please LIKE, COMMENT, SUBSCRIBE and SHARE with your friends.
    You can always connect with me at:
    LinkedIn: / parinita-hajra-69497588
    Facebook: / cseconceptswithparinita
    Telegram: t.me/CSEconcep...
    Instagram: / computer_science_concepts
    Whatsapp: chat.whatsapp....
    Mail: parinita1995@gmail.com
    ***********************************************************************************
    Compiler design tutorials:
    • Compiler Design for GA...
    Theory of computation (TOC) tutorials:
    • Theory of computation ...
    Cryptography techniques tutorials:
    • Cryptography Tutorial
    Artificial Intelligence tutorials:
    • AI vs ML vs DL vs data...
    GATE previous year important questions:
    • GATE 2023 important co...
    Data Compression tutorials:
    • Data Compression Tutorial
    Computer networks tutorials:
    • Computer Networks Tuto...
    Technical job updates:
    • Technical job updates
    Database management system tutorials: • DBMS: Database Managem...
    Data structures and Algorithms tutorials:
    • Data Structure and Alg...
    Programming questions:
    • Programming
    Digital image processing:
    • Digital Image Processi...
    Digital electronics:
    • Digital Logic
    Motivational videos:
    • Motivational Video
    Keep learning, keep supporting 🤝✨💯

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

  • @charlottehuntington9506
    @charlottehuntington9506 4 ปีที่แล้ว +12

    Dear mam you gave me confidence that i can clear my toc exam.the way you teach is more understandable than my proffessor tech us in lecture.❤

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

    God bless you, you explained way better than my professor, who I paid $10k

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

    THANK YOU! Studying night before. best explanation on yt for CGF! Commenting for algorithm! thank you!!!!!!

  • @ancientstories1648
    @ancientstories1648 4 ปีที่แล้ว +12

    Mam, you are a great teacher, understood the whole concept clearly and tomorrow is my exam!!!

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

      Glad to know that. Wish you all the best for your exam :)

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

      @@CSEconceptswithParinita Thank you mam, it was great :)

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

    THANK YOU SO MUCH! THANKS TO YOUR VIDEO I WAS ABLE TO DO AN EXERCISE I'VE BEEN TRYING SINCE YESTERDAY

  • @SanjaySingh-ud5ju
    @SanjaySingh-ud5ju 4 ปีที่แล้ว +4

    It is really one of the best explanations available online

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

    thank you very much. crystal clear concept. thanks once again. my online graded assignment is going on. thanks

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

    I believe this is also correct.
    For the first problem:
    S -> ASB|aa
    A -> a|b|lambda
    B -> a|b|lambda
    For the second problem:
    S -> ASB|1
    A -> 0|lambda
    B -> 0|1|lambda

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

    Thanks. this is really a great tutorial. very easy and clear explanation

  • @gautamhelange2769
    @gautamhelange2769 4 ปีที่แล้ว +5

    Easy Explanation...Thank You.

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

    Very nice explanationn thanxxx alot

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

    what a thorough and lovely explanation! thanks.

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

    you made it so easy keep growing

  • @TheGamingIndustry-YT
    @TheGamingIndustry-YT 8 หลายเดือนก่อน +1

    best explaination in youtube, thankyou so much mam :-)

    • @CSEconceptswithParinita
      @CSEconceptswithParinita  8 หลายเดือนก่อน +1

      I'm glad to hear that! Keep learning, keep supporting 🙂

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

    India might not have defeat Hitler, it may not have sent the first man to the Moon, but its great people did save millions of suffering Computer Science students :D

  • @sakshitagalpallewar9393
    @sakshitagalpallewar9393 4 ปีที่แล้ว +5

    Thank you mam 😊 nice explanation 👍

  • @MBindu-kc2nj
    @MBindu-kc2nj 2 ปีที่แล้ว +2

    Very helpful .Thank you man

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

    Awesome explanation

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

    Thanks a lot mam😘

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

    ooof you saved my ass this sem. 😀😂

  • @G24fg
    @G24fg 8 หลายเดือนก่อน +3

    thank youuuuuuuuuuuuuuuuuuuuu💗💗💗💗💗💗💗

    • @CSEconceptswithParinita
      @CSEconceptswithParinita  8 หลายเดือนก่อน +3

      Glad it was helpful! Keep learning, keep supporting 🙂

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

    . a. Explain why some programming languages require automatic memory management (“garbage collection”) for program execution?
    b. At a given point in the execution of a program, what can be considered as garbage? How can garbage be located in memory?

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

    Thank you a lot for the overall idea !!

  • @c.d.premkumar6867
    @c.d.premkumar6867 2 ปีที่แล้ว +2

    Excellent !

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

    Teacher you teach in a fabolous way

  • @ashwidafernando7178
    @ashwidafernando7178 8 หลายเดือนก่อน +1

    Thanks ma'am. Very clear

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

    nice explanation mam,Thank you

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

    best explanation!

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

    Very clear explanation!

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

    Nicely explained 👏👏

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

    nice teaching mam 😯

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

    Amazing! You made my day ^_^

  • @Khalidkhanofficial77
    @Khalidkhanofficial77 11 หลายเดือนก่อน +1

    great lecture👍

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

    Great thank you

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

    Thank you so much mam🙏

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

    You save my life
    .

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

    Thank you!

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

    Thankyou 🥺❤️

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

    Q2. Consider the following Context Free Grammar (CFG)
    𝑆 → 𝐴𝑎 | 𝐵𝐴𝑏
    𝐴 → 𝐵𝐵 | 𝑐
    𝐵 → 𝑆𝑑 | 𝑒
    where {a, b, c, d, e} is the set of terminal symbols.
    a. Give a right-most derivation of ecadeb.
    b. Give a left-most derivation of ecadeb.
    c. Compute FIRST and FOLLOW for this grammar?
    d. Discuss whether CFG is ambiguous or not and draw the parsing tree?

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

    RE is this (a+b)* generate two CFGs ??
    Kindly solve this

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

    Thank you :D

  • @gaurigarole19
    @gaurigarole19 4 หลายเดือนก่อน +1

    Thank you mam❤

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

    5:43 rip insect you will be missed

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

    what is cfg for ab^naa^n?

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

    hello mam
    0(0+1)*01(0+1)*1
    how can we solve this one
    confused little bit

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

    thank you

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

    But telegram we can't share our problem beczause its mute.

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

    Thanks mam

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

    Thnku mam ☺

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

    How about R = (b*ab*ab*)*b*

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

    Nice🙂

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

    Agar hame kuch poochna can we contact theough telegram or some where?

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

    in case of 2nd example if we use B instead of A ..........
    S=B1B
    B=0B/1B/^
    is this correct?

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

    A heads up, in the first example in your language L you marked "bbbaa" as a part of the language while it isn't
    This is because the (a+b)* group requires at least one letter "a" and exactly one "b" per repetition if the group exists; the CFG you have used would also recognize "baab" as a part of its language
    That being said, the CFG that I would use here is
    S -> AS | aaS | eps
    A -> aA | ab | eps
    This grammar should now NOT recognize "bbbaa" nor "baab" as a part of the language
    If I'm wrong feel free to correct me; I'm still trying to learn how to properly translate regex into CFG which basically brought me to watch this video!
    EDIT: Similar mistake happens in the second example
    Because of B -> 1B grammar will accept 11111 as a part of its language

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

      (a+b)* means 0 or more occurences of combination of a and b
      (a+b)+ means 1 or more occurences of combination of a and b
      so, the video is correct, you got confused, got it?

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

      @@ChocoFeather nope... I even gave explanations why they don't work
      (a+b)* indicates that if there's a "b" there MUST also be at least one "a" beforehand => "bbbaa" does not belong to the language L in the first example because it does NOT have at least one "a" before each "b", similar logic also applies to the example "baab" and the mistake repeats itself with (0+1)* once again

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

      @@vekyyy so, 'bb' doesn't belong to the language of this regex: (a+b) ?

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

      Or in (a+b)* ?

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

      @@ChocoFeather indeed
      (a+b)* => L = {ab, aab, aaab, abab, abaab ...}
      However:
      (a*b)* => L = {b, bb, ab, aab, bbaabbaaaabbbb, ...}

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

    Mam how to find CFG for (0)*(1(0+1)*

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

    Yeh log sirf easy question hi solve karte hai , who agree with me hit a like🙃

    • @CSEconceptswithParinita
      @CSEconceptswithParinita  10 หลายเดือนก่อน +1

      Kyuki ham ye sochke video banate hai ki jinko ye topic nahi aata, vo video dekhke ye topic seekh jaaye. And for that purpose, direct complicated example nahi le sakte as we have to think about a wider audience 🙃

  • @devi8755
    @devi8755 4 หลายเดือนก่อน

    Who

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

    The ant on the book distracted me a lot.. :p

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

      Apologies for that😂😂

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

      @@CSEconceptswithParinita its fine i was just kidding.. and thank you for teaching the concepts.. tomorrow i have exam.. whis me luck. 😁.

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

      Wish you all the best dear✌💯

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

      @@CSEconceptswithParinita thank u thank u..

  • @s.r.somyasamapika4474
    @s.r.somyasamapika4474 5 ปีที่แล้ว +2

    U r explaining too much which is disgusting... Otherwise its a praiseworthy explanation..

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

      Thank you Somya for your opinion. Can you please elaborate what actually you didn't like?

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

      Somya you sound brainless..
      Free help given by someone who you don't even know..
      Likely wants to help everyone succeed, how about you upload a video
      so we can laugh at you incompetence? Or sit down and learn your place.

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

      @@CSEconceptswithParinita The video is outstanding, really helped me after hours of searching.
      Some people just aren't happy..lol

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

      @@litlabproductions2043 thank you so much! The support of people like you keeps me going 😊