Ambiguous Grammar

Поделиться
HTML-код
  • Опубликовано: 17 ноя 2024

Комментарии • 116

  • @RiaziMohandesi
    @RiaziMohandesi 3 года назад +96

    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 10 месяцев назад +2

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

    • @TragicGFuel
      @TragicGFuel 8 месяцев назад

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

  • @arsha1625
    @arsha1625 4 года назад +48

    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❤️

  • @_kuldeepk_
    @_kuldeepk_ 6 лет назад +127

    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.

    • @alpharohann
      @alpharohann 5 лет назад +1

      Yes either more than one right most derivation tree or left most derivation tree

    • @WowPlusWow
      @WowPlusWow 4 года назад +10

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

  • @samikshagarhewal1645
    @samikshagarhewal1645 Год назад +23

    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 9 месяцев назад

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

    • @tasty0rang3
      @tasty0rang3 8 месяцев назад

      @@naveenkumargembali3494yes

    • @AntarikshRajkonwar
      @AntarikshRajkonwar 5 месяцев назад

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

    • @speedngears
      @speedngears 8 дней назад

      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

  • @sumitaggarwal9477
    @sumitaggarwal9477 7 лет назад +22

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

  • @vikaschauhan6442
    @vikaschauhan6442 5 лет назад +1

    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

  • @vaibhavpatil8190
    @vaibhavpatil8190 2 года назад +4

    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

    • @SanyamSharma-f3b
      @SanyamSharma-f3b 14 дней назад +2

      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

  • @shikhasolanki2689
    @shikhasolanki2689 7 лет назад +11

    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...

  • @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

  • @Rahul-bb5zd
    @Rahul-bb5zd 9 месяцев назад

    Very helpful 👍Thank you sir !!

  • @hahahhaaaa
    @hahahhaaaa 4 года назад +1

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

  • @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 5 лет назад

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

  • @speedngears
    @speedngears 8 дней назад

    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

  • @farjananasrinanika2117
    @farjananasrinanika2117 2 года назад +2

    Please make a video converting ambiguous to unambiguous

  • @srikanyabhattacharya9850
    @srikanyabhattacharya9850 7 лет назад +5

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

  • @arun9385
    @arun9385 4 года назад

    Please add more about discrete mathematics

  • @priyasharma293
    @priyasharma293 5 лет назад +4

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

  • @mohammedsuhail3654
    @mohammedsuhail3654 4 года назад +1

    Thank you so much sir

  • @abishekbabu9247
    @abishekbabu9247 4 года назад

    Brilliant Explanation Dear Brother

  • @tube-rp1nb
    @tube-rp1nb 4 года назад +2

    this series is really amazing . 10Q man

  • @devmahad
    @devmahad Год назад

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

  • @shivambmgupta
    @shivambmgupta 5 лет назад +3

    Some grammars are just like my future: Ambiguous.

  • @pateldhruv046
    @pateldhruv046 3 года назад

    Good Explanation

  • @vixxkigoli345
    @vixxkigoli345 5 лет назад +1

    Thanks very well explained.

  • @saddaadda9166
    @saddaadda9166 7 лет назад +1

    Sir upload the lecture on communication systems and electromagnetic theory

  • @mr.lonely4595
    @mr.lonely4595 2 года назад

    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

  • @pranavdesai4398
    @pranavdesai4398 2 года назад +3

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

  • @ivc1740
    @ivc1740 7 лет назад +1

    thank u sir, your videos are helpful.

  • @diptanshumalviya7547
    @diptanshumalviya7547 3 года назад

    Thank You Sir

  • @divyaanshuagrawal3383
    @divyaanshuagrawal3383 Год назад

    Thanks sir!

  • @jc120111
    @jc120111 5 лет назад +4

    two or more right-derivation trees is ambiguous too?

  • @jayeshjadhav3024
    @jayeshjadhav3024 4 года назад +4

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

  • @expressEmotion
    @expressEmotion 5 лет назад +2

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

  • @marcinsznn
    @marcinsznn 7 лет назад

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

  • @zio.h4344
    @zio.h4344 7 лет назад +9

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

  • @sayantaniguha8519
    @sayantaniguha8519 2 года назад +1

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

  • @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

    • @AmitSingh-1916
      @AmitSingh-1916 4 года назад

      @Tech RK really?? is it right method?

  • @58harshverma57
    @58harshverma57 Год назад +1

    What is a+b means in the notation?

  • @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 ?

  • @imraanhabibulla233
    @imraanhabibulla233 Год назад

    Big fan of your work💟

  • @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.

  • @akshayjagirdaar8905
    @akshayjagirdaar8905 6 лет назад

    really its very useful to me

  • @excelbasics2769
    @excelbasics2769 2 года назад

    شکریہ سر

  • @AhamedKabeer-wn1jb
    @AhamedKabeer-wn1jb 4 года назад

    Thank you..

  • @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?

  • @piyushmishra860
    @piyushmishra860 2 года назад +1

    Tq so muchh sir

  • @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

  • @vamshikrishnanoora564
    @vamshikrishnanoora564 7 лет назад

    sir please add further topics on these videos

  • @enduga0
    @enduga0 Год назад

    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?

  • @naveenkumargembali3494
    @naveenkumargembali3494 9 месяцев назад

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

  • @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

  • @narendraparmar1631
    @narendraparmar1631 5 лет назад

    thanks sir

  • @Sy06274
    @Sy06274 Год назад

    derivation tree means parse tree ??

  • @larekgk9286
    @larekgk9286 7 лет назад

    sir please upload feedback amplifier

  • @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?

  • @Gameplay-pq6hk
    @Gameplay-pq6hk 7 лет назад

    thanks a lot sir !

  • @sravanmallepoola8873
    @sravanmallepoola8873 4 года назад

    What is two or more right derivation trees

  • @berylnekesa7317
    @berylnekesa7317 6 лет назад

    great explanation...thank you!

  • @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)

  • @robertjimenez5608
    @robertjimenez5608 2 года назад

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

  • @Asli_coding
    @Asli_coding Год назад

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

  • @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

  • @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.

  • @iqrar318
    @iqrar318 7 лет назад

    good effort

  • @dinoarmy2440
    @dinoarmy2440 9 месяцев назад

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

  • @goel97umang
    @goel97umang 6 лет назад +3

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

  • @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

  • @جيمرمصري-ق5ق
    @جيمرمصري-ق5ق 4 года назад

    hi where can i find more examples

  • @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.

  • @simransinha5298
    @simransinha5298 10 месяцев назад

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

  • @mohammadratebhamso8174
    @mohammadratebhamso8174 3 года назад

    i love you

  • @harshsha0562
    @harshsha0562 4 месяца назад

    ❤❤

  • @hashhash622
    @hashhash622 3 года назад

    0:20

  • @vinayaksharma-ys3ip
    @vinayaksharma-ys3ip 3 года назад

    👍👍👍👍👍

  • @jamethou6217
    @jamethou6217 7 лет назад

    Open bob

  • @mustafa_cabi
    @mustafa_cabi 10 месяцев назад

    thank you