Prove that the following grammar is ambiguous [closed] - ambiguous

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
S-> A|B|AB
A-> aA, B-> bB, A->€, B->€
€ is the empty string.
Find a string and show that it has two
a-) parse trees
b-) leftmost derivations
c-) rightmost derivations

We're not gonna do your homework.
Build the parse tree using leftmost and rightmost derivations. If you can find any ambiguity, it is ambigious.
S-> A|B|AB is the key part. Try using both A, B and AB.

Related

Error in latex document during writing an equation. 'Missing { inserted' and 'missing } inserted' [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 months ago.
The community reviewed whether to reopen this question 9 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
\begin{equation} df = \frac{(\frac{{s_\bar{n_1}}^2}{n_1} + \frac{{s_\bar{n_2}}^2}{n_2})^2}{\frac{{s_1}^4}{{{n_1}^2}(n_1 - 1)} + \frac{{s_2}^4}{{n_2}^2(n_2 - 1)}} \end{equation}
Pro tip: whenever you encounter such an error from LaTeX, remove or comment out parts of your code until it starts working, then gradually add them back again until you've found the problem.
In this case, it's here:
s_\bar{n_1}
The part after the first _ is more than a single token, so it needs some extra curly braces:
s_{\bar{n_1}}

What does ";" mean in this equation? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 3 years ago.
Improve this question
What does ";" mean in this equation?
y = f(x;θ)
or
equation
f(X;A) means the function f is function of variables X , with regarding of the parameters A.
As an example, F(X;A)= a*x^x+b*x+c where X=[x] is variable, and A=[a,b,c] are the parameters.

Why is everything a tuple in swift? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
So I found out that any variable or constant in swift is a tuple. For example, variable x below is a tuple
var x = 15
and following statement is valid and evaluates to value of x as the first element of tuple
x.0.0.0.0.0.0.0.0.0.0.0 // outputs 15
I'm wondering why the language has been built to accommodate this. Any known (or outworldly) use case?
I don't know can it be the right answer, but it gives some information and shows that it's a known thing. Look this 2 sections:
Special: The 1-Tuple
Bonus Track: Tuples All the Way Down

can a top-down parser detect ungrammaticality an input string? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I read that its possible to do this ,
Will it require backtracking?
What would be the sketch from recovering from the parsing errors .
The way a top down parser can detect the ungrammaticality, i.e. the invalidity of an input string is, for example:
if you have the non-terminal A on the top of your stack for instance, and the next token in your input string is the symbol b,
then go to your parse table and go to the row for A, and the column for b, and if there is an empty cell, then the input string is invalid.
A method to recover would be to entry panic mode, where you skip tokens in the input string until you find one in the synchronising set, and then pop A off the stack and continue.
several ways of choosing the synchronising set, it could be follow(A) for example

What are these and how do I remove them using Ruby? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I have a string from user input that is in the following format:
"foo\U+FFE2\U+FFB5\U+FFE2\U+FFB5"
When I view this it does not show anything in the browser or terminal, but they are definitely there.
What are they and how do I remove all junk chars like these to end up with just 'foo'?
I know I could just remove these specific ones but there maybe other different ones that I want just the text value from.
Any ideas?
I see the two main variants:
with #split/#join pair:
"fooффф".split('').select{|x|x.ord <= 127}.join
# => "foo"
with #unpack/#pack pair:
"fooффф".unpack('U*').select{|x| x <= 127}.pack('U*')
# => "foo"

Resources