Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2014-01-26 05:54:34

evinda
Member
Registered: 2013-04-13
Posts: 105

How can I know the number of all the possible parse trees?

Hello!!! smile
Let

the following grammar with
and with start symbol
:



I have to make all the possible parse trees for the word

But how can I know how many possible parse trees there are?Is there a formula with which I can find the number of all the possible parse trees?

Offline

#2 2014-01-26 08:00:06

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,049

Re: How can I know the number of all the possible parse trees?

I think there are 6 of them here, since the difference between the trees will be in which order do you go through the operations (that is, those elements that correspond to P). You can go -+*,-*+,+-*,+*-,*-+ or *+-.


“Here lies the reader who will never open this book. He is forever dead.
“Taking a new step, uttering a new word, is what people fear most.” ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

#3 2014-01-26 10:58:38

evinda
Member
Registered: 2013-04-13
Posts: 105

Re: How can I know the number of all the possible parse trees?

anonimnystefy wrote:

I think there are 6 of them here, since the difference between the trees will be in which order do you go through the operations (that is, those elements that correspond to P). You can go -+*,-*+,+-*,+*-,*-+ or *+-.

Ok..thank you very much!!! smile

Offline

#4 2014-01-26 11:07:46

John E. Franklin
Member
Registered: 2005-08-29
Posts: 3,588

Re: How can I know the number of all the possible parse trees?

I don't know this stuff, but is the "/" being missed here?


igloo myrtilles fourmis

Offline

Board footer

Powered by FluxBB