GATE CSE
First time here? Checkout the FAQ!
x
+1 vote
132 views

 

asked in Compiler Design by Boss (5.1k points)   | 132 views
@valshall 2$4$8$? actually i have typed 2Dollar4Dollar8Dollar. But somehow that $ is not showing up.
I think some $ is missing in your answer
2 $ 4 $ 8 $...

@amitabh is right ..don't know why dollar is not showing

 

Is this answer possible?

dollar b/w 4 nd 8 should be there and after 8 only one dollar
Nopes

2 Answers

+1 vote

SDT evaluation

answered by Active (2.3k points)  
S --> XY

S --> ZXY

S --> ZX*XY

S --> ZX*ZXY

S --> ZX*ZZXY

@amitabh...see this
that is what i have derived...complete the derivation you will get the same answer.

Is this right?

No. See where you are going wrong is : ZX when reduced to X --->prints $. But when epsilon is reduced to X,it doesn't print $. See the grammar carefully.
She has printed the second dollar where actually  the first dollar is printed. But second dollar will also be printed in the subsequent step when again zx reduces to X. So her final answer is correct.
0 votes

2dollar48 dollar dollar is possible.ZX is reduced to X twice at last

answered by (115 points)  
edited by
Top Users Jan 2017
  1. Debashish Deka

    7172 Points

  2. Habibkhan

    4696 Points

  3. Vijay Thakur

    4308 Points

  4. sudsho

    4090 Points

  5. saurabh rai

    4024 Points

  6. Arjun

    3292 Points

  7. santhoshdevulapally

    3066 Points

  8. GateSet

    3016 Points

  9. Bikram

    3014 Points

  10. Sushant Gokhale

    2892 Points

Monthly Topper: Rs. 500 gift card

18,838 questions
23,808 answers
51,589 comments
20,148 users