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 🤝✨💯
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.❤
I'm really happy to know that 😊
Keep learning, keep sharing ✌
God bless you, you explained way better than my professor, who I paid $10k
Happy to help😊
THANK YOU! Studying night before. best explanation on yt for CGF! Commenting for algorithm! thank you!!!!!!
Thank you for acknowledging 😊
Keep learning, keep sharing ✌️
Mam, you are a great teacher, understood the whole concept clearly and tomorrow is my exam!!!
Glad to know that. Wish you all the best for your exam :)
@@CSEconceptswithParinita Thank you mam, it was great :)
THANK YOU SO MUCH! THANKS TO YOUR VIDEO I WAS ABLE TO DO AN EXERCISE I'VE BEEN TRYING SINCE YESTERDAY
I'm glad to hear this😊 keep learning, keep supporting 🤝
It is really one of the best explanations available online
Thanks for such a compliment 😊
thank you very much. crystal clear concept. thanks once again. my online graded assignment is going on. thanks
Happy to help😊
Keep learning, keep sharing ✌
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
Thanks. this is really a great tutorial. very easy and clear explanation
My pleasure😊 Keep learning, keep sharing ✌
Easy Explanation...Thank You.
You're welcome 😊
Very nice explanationn thanxxx alot
You're welcome. Keep learning, keep sharing ✌😊
what a thorough and lovely explanation! thanks.
My pleasure 😊 Keep learning ,keep sharing ✌
you made it so easy keep growing
Keep learning, keep sharing 😊
best explaination in youtube, thankyou so much mam :-)
I'm glad to hear that! Keep learning, keep supporting 🙂
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
Hahaha
We have other achievements but it's ok
Thank you mam 😊 nice explanation 👍
Thanks dear for the acknowledgement 😊
Very helpful .Thank you man
Keep learning, keep sharing ✌️🙂
Awesome explanation
Thanks for the acknowledgement 😊
Thanks a lot mam😘
ooof you saved my ass this sem. 😀😂
thank youuuuuuuuuuuuuuuuuuuuu💗💗💗💗💗💗💗
Glad it was helpful! Keep learning, keep supporting 🙂
. 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?
Thank you a lot for the overall idea !!
My pleasure 😊
Excellent !
Keep learning, keep sharing ✌ 😊
Teacher you teach in a fabolous way
Thanks for acknowledging! Keep learning, keep sharing 😊
Thanks ma'am. Very clear
Glad it helped! Keep learning, keep supporting 🙂
nice explanation mam,Thank you
Keep learning, keep sharing 🙂
best explanation!
Keep learning, keep sharing ✌ 😊
@@CSEconceptswithParinita thank you so much for your help! you are a great teacher!
I'm glad to hear that🙂
Very clear explanation!
Thanks for your feedback 😊
Nicely explained 👏👏
Thanks for the acknowledgement :)
nice teaching mam 😯
Thanks for your feedback 😊
Amazing! You made my day ^_^
Keep learning, keep sharing ✌😊
great lecture👍
Keep learning, keep sharing 😊
Great thank you
My pleasure 😊Keep learning, keep sharing ✌
Thank you so much mam🙏
Completely my pleasure 😊
You save my life
.
Keep learning, keep supporting 🤝
Thank you!
Keep learning, keep sharing 😊
Thankyou 🥺❤️
My pleasure 😊
Keep learning, keep sharing ✌
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?
RE is this (a+b)* generate two CFGs ??
Kindly solve this
Thank you :D
Keep learning, keep sharing ✌ 😊
Thank you mam❤
Most welcome 😊 keep learning, keep supporting ✨
5:43 rip insect you will be missed
Good observation 😂😂
what is cfg for ab^naa^n?
hello mam
0(0+1)*01(0+1)*1
how can we solve this one
confused little bit
thank you
Welcome! Keep learning, keep supporting ✨
But telegram we can't share our problem beczause its mute.
Share in whatsapp group / LinkedIn/ Facebook
Thanks mam
My pleasure 😊
Thnku mam ☺
You're welcome. Keep learning, keep sharing ✌😊
How about R = (b*ab*ab*)*b*
Nice🙂
Thank you 😊
Agar hame kuch poochna can we contact theough telegram or some where?
Through any of my social media handles
in case of 2nd example if we use B instead of A ..........
S=B1B
B=0B/1B/^
is this correct?
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
(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?
@@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
@@vekyyy so, 'bb' doesn't belong to the language of this regex: (a+b) ?
Or in (a+b)* ?
@@ChocoFeather indeed
(a+b)* => L = {ab, aab, aaab, abab, abaab ...}
However:
(a*b)* => L = {b, bb, ab, aab, bbaabbaaaabbbb, ...}
Mam how to find CFG for (0)*(1(0+1)*
Yeh log sirf easy question hi solve karte hai , who agree with me hit a like🙃
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 🙃
Who
The ant on the book distracted me a lot.. :p
Apologies for that😂😂
@@CSEconceptswithParinita its fine i was just kidding.. and thank you for teaching the concepts.. tomorrow i have exam.. whis me luck. 😁.
Wish you all the best dear✌💯
@@CSEconceptswithParinita thank u thank u..
U r explaining too much which is disgusting... Otherwise its a praiseworthy explanation..
Thank you Somya for your opinion. Can you please elaborate what actually you didn't like?
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.
@@CSEconceptswithParinita The video is outstanding, really helped me after hours of searching.
Some people just aren't happy..lol
@@litlabproductions2043 thank you so much! The support of people like you keeps me going 😊