Ambiguous Grammar

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ก.พ. 2025

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

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

    i am watching these videos serially... and this is the best resource available on this topic

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

    Now I am preparing lecture notes using your lectures from beginning..I will finish the whole toc lectures in few more days..I will score better marks for toc exam❤️

  • @samikshagarhewal1645
    @samikshagarhewal1645 ปีที่แล้ว +33

    Basically if anyone still finds ambiguous questions hard to solve just remember that prove that question through both right most deviations and left most deviations

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

      If one is built on left derivation and other is right derivation, can we say it is ambiguous.. ??

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

      @@naveenkumargembali3494yes

    • @AntarikshRajkonwar
      @AntarikshRajkonwar 7 หลายเดือนก่อน

      Nope, you have to derive the string only with the left derivation tree​@@naveenkumargembali3494

    • @speedngears
      @speedngears 2 หลายเดือนก่อน

      Suppose that two parse trees has the same root as well as starting inputs and then they differ does that make the grammar ambiguous or not ?
      For example
      If S-> aB | bA
      And if both the parse trees derive starts with aB but from 2nd input they differ then the grammar become ambiguous or not ?
      Or both the parse trees must have different strat as one parse trees start with input aB, then another must start with bA
      Then only the grammar become ambiguous

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

      @@naveenkumargembali3494 no
      it has to be either 2 or more than left most or 2 or more right most

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

    A context-free grammar G is said to be ambiguous if there exists some w ∈ L (G) that has at least two distinct derivation trees. Alternatively, ambiguity implies the existence of two or more leftmost or rightmost derivations.
    Introduction To Formal Languages And Automata, 6 Edition
    Peter Linz

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

      oho guruji. video me to kuch aur hi btaya hai

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

      A grammar that has more than one rightmost derivation for some string in the language generated by the grammar is called a right-recursive grammar. Right-recursive grammars are not necessarily ambiguous

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

      SRM se ho?

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

      Video me right derivation tree ke baare me nahi mention kiya hai.
      @@humaneBicycle

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

      ​@@humaneBicyclegawar ho kya? English padhna nhi aata?

  • @_kuldeepk_
    @_kuldeepk_ 6 ปีที่แล้ว +131

    Sir please mention this also as a note that language with two or more right derivation for same sentence is also ambiguous.

    • @ibrahim47
      @ibrahim47 6 ปีที่แล้ว +15

      i think it's a trivial and redundant conclusion.

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

      left or right doesn't matter, the two derivations just need to have the same structure.

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

    You are very good work for providing free toc class

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

    thanks man, i'm studying designing compilers and this a good insight of the ambiguity topic thanks again

  • @Dr.helicopter
    @Dr.helicopter 22 วันที่ผ่านมา

    a way better explanation then what my professor gave. thank you kind indian man

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

    tomorrow is my paper of TOC i learnt so many things from your videos..
    but pushdown automata and turing machine..is not in your 77 videos..
    but anyway THANKYOU SIR...

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

    this is a saviour...!thank you sir!

  • @tube-rp1nb
    @tube-rp1nb 5 ปีที่แล้ว +2

    this series is really amazing . 10Q man

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

    In place of 2 or more derivative tree... simply we can use more than 1 derivations....I think this is very easy to remember

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

    Concept is correct but in 2nd line of S--> S*S , I think it should be (S+S)*S = S*S+S*S

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

      yesi feel same

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

      Yes I think 🤔.u r right

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

      No , here the + and * are not treated as operators , they are just terminal symbols like a and b
      so (s+s) * s will be just s + s * s ,
      don't open the parenthesis like operators but like normal symbols
      as in ---
      (s a s ) b s == s a s b s

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

    Tysm sir ☺it's really very helpful for me😃 thank u so much

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

      My pleasure

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

    Thank you so much sir

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

    I will donate you at the end of my semester for your videos. Thank you isn't enough

  • @Rahul-bb5zd
    @Rahul-bb5zd 11 หลายเดือนก่อน

    Very helpful 👍Thank you sir !!

  • @mr.lonely4595
    @mr.lonely4595 2 ปีที่แล้ว +3

    in our country only thing we know about india is bollywood
    but now as a computer engineering student i would say big respect for you and i would FAİL all my exams if not you and another indian channels
    F

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

    Thanks so much sir.next week my toc University exam.your video is my book.more helpfully notes thanks allot

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

      (0+1)*(0+1)01 I have doubt in this sum to change as minimization of DFA please slove this sum sir

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

    Brilliant Explanation Dear Brother

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

    What is a+b means in the notation?

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

    Hey @neso u havent added the closing brackets at 01:49. Pls re-upload

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

    Big fan of your work💟

  • @speedngears
    @speedngears 2 หลายเดือนก่อน

    Suppose that two parse trees has the same root as well as starting inputs and then they differ does that make the grammar ambiguous or not ?
    For example
    If S-> aB | bA
    And if both the parse trees derive starts with aB but from 2nd input they differ then the grammar become ambiguous or not ?
    Or both the parse trees must have different strat as one parse trees start with input aB, then another must start with bA
    Then only the grammar become ambiguous

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

    thank u sir, your videos are helpful.

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

    Thanks very well explained.

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

    Please make a video converting ambiguous to unambiguous

  • @Safwan.Hossain
    @Safwan.Hossain 2 หลายเดือนก่อน

    In the set of terminal symbols, why is `a+b` a terminal symbol here? If that is the case, how can we we even use the production rule `S -> a` or `S -> b` if `a` and `b` are not terminal symbols themselves? Was it a typo that should've been a comma between those characters instead of a plus symbol?

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

    Please add more about discrete mathematics

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

    Good Explanation

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

    Thank You Sir

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

    two or more right-derivation trees is ambiguous too?

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

    The grammar in the last lecture was also ambiguous, right ?

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

    Thanks sir!

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

    we are talking about tree so why we are not making it??

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

    Some grammars are just like my future: Ambiguous.

  • @zio.h4344
    @zio.h4344 7 ปีที่แล้ว +9

    hello ! can we have a course about push down automata, thanks X)

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

    Thankyou sir

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

    A grammer is said to be ambiguous if there exists two or more derivation tree for a string W.

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

    Sir upload the lecture on communication systems and electromagnetic theory

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

    really its very useful to me

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

    شکریہ سر

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

    In the question its mentioned as S*S and at 2:42 you mention S into S. Are both the things the same?

  • @SandeepKaur-su4it
    @SandeepKaur-su4it 5 ปีที่แล้ว

    👏 👏👏sir your teaching way is vry easy and understandable.... i really impressed by you ... god bless you🌹🌹 sir and thx

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

    Tq so muchh sir

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

    Thank you..

  • @marcinsznn
    @marcinsznn 7 ปีที่แล้ว

    record some lectures about checking if the language is regular or not, about top-down parsing and the opposite.

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

    You said in previous video for left d tree we have to expand left most possible alphabet but here you are expanding the right one.. Why?

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

    In 2nd tree you first replaced right S with (S*S) which contradicts the rule of LMD, please explain.

  • @Gameplay-pq6hk
    @Gameplay-pq6hk 7 ปีที่แล้ว

    thanks a lot sir !

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

    hi, very interesting lectures ! i had an subject 'formal languages and compilation methods' and we had a exercise on the exam : we had a grammar and we had to check if this language is ambigous . How to do It ?

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

    1:00 you said 'no' if there is one left and one right., but can it be ambiguous if we get 2 or more right trees? Is that possible?

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

      yes, it is

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

      Yes a language is ambiguous if it can generate at-least one sentence from two left most derivation or two right most derivation. The following statements are equivalent.
      • A CFG is ambiguous if some sentence it generates has more than one
      derivation tree
      • A CFG is ambiguous if there is a some sentence it generates with more
      than one left-most derivation
      • A CFG is ambiguous if there is a some sentence it generates with more
      than one right-most derivation

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

      if there exist multiple right-most or left-most derivation for some string generated from grammar it's ambiguous

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

    there is a mistake, in S*S you have directly written S+S*S but it should be (S+S)*S

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

      @Tech RK really?? is it right method?

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

    derivation tree means parse tree ??

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

    thanks sir

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

    What is two or more right derivation trees

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

    4:25 you write s->s*s -> s+s*s But I think that's should be s->s*s -> (s+s)*s.

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

    Sir i have a question what if the example was a+a +b would it then be ambiguous or no?

  • @جيمرمصري-ق5ق
    @جيمرمصري-ق5ق 4 ปีที่แล้ว

    hi where can i find more examples

  • @surajbhatt3938
    @surajbhatt3938 6 ปีที่แล้ว +14

    In second tree
    S is replaced by (s+s)*s....
    s+s*s where did that come from..

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

      Suraj Bhatt Instead start with S+S and replace first S with S*S , then u have S*S + S, now out a,b appropriately. Hope it helps u out cuz Sir did a mistake in the video

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

    great explanation...thank you!

  • @vamshikrishnanoora564
    @vamshikrishnanoora564 7 ปีที่แล้ว

    sir please add further topics on these videos

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

    What if we are not given a string but only a grammar. How would we go about trying to find a string that can be obtained by two different left derivation trees?

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

      Philiey pick an string to demonstrate

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

    After watching this lecture I thought why I am paying lakhs in my college

  • @iqrar318
    @iqrar318 7 ปีที่แล้ว

    good effort

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

    im not able to understand this pls anyone explain i hv toc exam next week......

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

    If one is built on left derivation and other is right derivation, can we say it is ambiguous..

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

    how are both derivation trees left? i guess first one was right and second was left.. please explain!!!

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

      That's mine doubt too 😎

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

    why (s+s)*s is not equal to s*s +s*s instead of s+s*s tommorow is my exam someone plz tell me

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

    I am more focused on bracket mismatch 1:12 😅😅

  • @larekgk9286
    @larekgk9286 7 ปีที่แล้ว

    sir please upload feedback amplifier

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

    In the ambiguity video by @gatesmasher, he mentions that whether it's LMD or RMD, if we obtain two derivation trees simultaneously, it is considered ambiguous. However, in your lecture, you assert that it should be only LMD with two derivation trees. Now, I am confused about whose perspective is accurate - yours or gatesmasher's.

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

    can any body help me?
    A grammar has the following productions: S --> aSSb | a | bSa
    Which of the following sentences are in the language that is generated by this grammar?
    a) aabbaabb
    b) aaaaabb
    c) bbbaabbaa
    d) none of the answers above are correct

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

      its b)
      S -> aSSb
      aSSb -> aSaSSbb (S -> aSSb)
      aSaSSbb -> aaaSSbb (S -> a)
      aaaSSbb -> aaaaSbb (S -> a)
      aaaaSbb -> aaaaabb (S -> a)

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

    unambiguous?

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

      if only one left derivation tree exists,then its unambiguous

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

    S -> SS+ | SS* | a . Why this grammar is not Ambiguous help me please.

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

    0:20

  • @harshsha0562
    @harshsha0562 7 หลายเดือนก่อน

    ❤❤

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

    👍👍👍👍👍

  • @jamethou6217
    @jamethou6217 7 ปีที่แล้ว

    Open bob

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

    thank you