Context-Free Grammar Definitions: Yields, Ambiguous, Leftmost Derivation

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ส.ค. 2024
  • Here we are doing a bonus video about context-free grammars (CFGs): yields, ambiguous, and leftmost derivation. They will all be important in upcoming videos. Yields involves the application of a single rule, and a derivation is a sequence of yields operations to yield a string that is only consisting of terminals. A leftmost derivation is one where the leftmost variable is always the one that is replaced. Ambiguous grammars are those that have some string they make that has 2 different leftmost derivations. A language is inherently ambiguous if every CFG for it is ambiguous.
    Donation (appears on streams): streamlabs.com...
    Paypal: paypal.me/easy...
    Patreon: / easytheory
    Discord: / discord
    #easytheory #gate #theory
    TH-cam Live Streaming (Sundays) - subscribe for when these occur.
    Social Media:
    Facebook Page: / easytheory
    Facebook group: / easytheory
    Twitter: / easytheory
    Merch:
    Language Hierarchy Apparel: teespring.com/...
    Pumping Lemma Apparel: teespring.com/...
    If you like this content, please consider subscribing to my channel: / @easytheory
    Gold Supporters: Micah Wood
    Silver Supporters: Timmy Gy
    ▶SEND ME THEORY QUESTIONS◀
    ryan.e.dougherty@icloud.com
    ▶ABOUT ME◀
    I am a professor of Computer Science, and am passionate about CS theory. I have taught many courses at several different universities, including several sections of undergraduate and graduate theory-level classes.

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

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

    Man Seriously You Deserve Lot of appreciation for your work!

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

    Thank you!! you are why I am passing computational theory

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

    This is awesome content. actually saved my life.

  • @vimalathithand917
    @vimalathithand917 8 หลายเดือนก่อน

    Thanks! Really got insights ,a great video !

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

    You're gonna shine one day proffesor!

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

    Thanks for the video!

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

    Thank you! that was really helpful !

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

    Great video!! i clicked on this video because of the thumbnail btw.

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

    thank you bro

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

    great work bro

  • @jacobh1833
    @jacobh1833 11 หลายเดือนก่อน

    Is the * in the E set of terminals just mean 'the permutation/combinations of all elements in the set E' or does it have a more nuanced definition?

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

    thanks!

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

    Hi, the two examples you shared for left most derivations, in the first example when you have replaced S with epsilon only, how is that a leftmost derivation when you've merely used a rule? The second makes sense that you've replaced the left most variable with a epsilon. Please help

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

    Hey! Nice vid. Could you make a video explaining reductions in a deterministic CFG? I find it very hard to understand

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

      What do you mean by reduction?

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

      @@EasyTheory the bottom up derivation. In Sipser, a DCFG is defined by a series of reduction from a string of all terminal to the start variable.

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

      @@itsmemouha2811 Didn't know about that! Got some reading to do 👀

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

    In Ambiguous, the derivation has to have the same answer?

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

    for the second derivation you did for S -> SS | ε, why is this considered leftmost derivation because aren't we still replacing the S on the right? I thought leftmost derivation means you only replace leftmost variables, but once you have done that, are you allowed to replace another variable that is not the leftmost one?
    Edit: Is it because we cannot end on a variable so we need to replace the right one?

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

      I might misunderstand your question and my answer may be off ( i am learning as well). But, with a leftmost derivation you start with variables to the left and replace them moving left->right until the string is in the set of terminals. You don't just replace the leftmost variable. If you only replaced the leftmost variable and there were other variables in the string, the derivation would be incomplete. Does this answer the question?