## Show {𝑎^i𝑏^j𝑐^k, i!=j!=k} is context free or not, how can we prove it?

I stuck on this question for a long time and cannot figure out how to prove it?

Posted on Categories proxies

## a^ib^jc^k, i < j < k is a context-sensitive language, how can prove it as a context sensitive

I am thinking this question for a long time, that a^ib^jc^k, i < j < k is a context-sensitive language, how we can prove it as a context sensitive or which grammar can generate such a language. Thanks for all of your help

Posted on Categories proxies

## What does the ‘ (prime) mean in this context?

I’m trying to check a simple calculation regarding the derivative of a matrix exponential. By hand I get $$\frac{d}{d\theta_1}e^{\theta_1 \mathbf{W_1}+\theta_2\mathbf{W_2}} = \mathbf{W_1}e^{\theta_1 \mathbf{W_1}+\theta_2\mathbf{W_2}}.$$ Checking this with Mathematica, I have

Assuming [{\[Theta]1 \[Element] Reals, {W1, W2} \[Element]     Matrices[{d, d}, Reals, Symmetric]},   D[MatrixExp[ (\[Theta]1 W1 + \[Theta]2 W2)], \[Theta]1]] 

which returns

(* W1 Derivative[MatrixExp][W1 \[Theta]1 + W2 \[Theta]2] *) 

Why is there a derivatie here? And what’s the ?

## determining decidability with intersection of context free languages

I am trying to solve this problem: Given context-free languages A, B, and C find if the language $$(A\cap B)\cup (B\cap C)$$ is empty. Is this problem decidable.

I know the CFG is not closed under intersection so we do not know that $$A\cap B$$ is also CFG. If it was CFG, I know how to prove decidability. Since we can’t determine about $$A\cap B$$, is there a way to prove whether or not this is decidable?

Posted on Categories proxies

## Context free languages invariant by “shuffling” right hand side

Given a grammar for a Context Free language $$L$$, we can augment it by "shuffling" the right hand side of each production, e.g.:

$$A \to BCD$$ is expanded to $$A \to BCD \; | \; BDC \; | \; CBD \; | CDB \; | \; DBC \; | \; DCB$$

It may happen that the resulting language $$L’$$ is equal to $$L$$

For example:

Source               Shuffled S -> XA | YB         S -> XA | AX | YB | BY A -> YS | SY         A -> YS | SY B -> XS | SX         B -> XS | SX X -> 1               X -> 1 Y -> 0               Y -> 0 

Is there a name for such class of CF languages ($$L = \text{shuffled}(L)$$?

Posted on Categories proxies

## If A is context free then A* is regular

I am currently studying for my exam and I am having trouble to solve this question :

If A is context free then A* is regular . (Wrong or right)

I think its wrong because if A is context free it means that A can be a non regular languague. And the non regular languagues are not closed under the kleene star operation(At least I think so). I am not sure how write this in a more formal way.

Maybe like this ? : Let A=$$\{a^nb^n|n \in \mathbb{N}\}$$. Then we know that A is non regular and context free. Then A*= I am not sure about this :/

## Help with context free grammar excercise

So, I have an exercise in which I have to write a context free grammar for this language:

$$L = \{x \in L(a^∗b^∗c^∗) : |x|_a > |x|_c; |x|_b > 0; |x|_c ≥ 0\}$$

meaning every string with any number of $$a$$‘s, $$b$$‘s and $$c$$‘s in that order, with the amount of $$a$$‘s greater than the amount of $$c$$‘s and the amount of $$b$$‘s greater than zero.

I am having trouble figuring out the rule that makes sure there are more $$a$$s than $$c$$s.

I have: \begin{align}S&\to aABC | ab\ A&\to aA | a\ B&\to bB | b\ C&\to cC | c\ \end{align} I know this is wrong because I should be adding an $$a$$ every time I add a $$c$$, but I don’t know how to write that.

## How to interpret this context free language?

$$S -> aAA$$

$$A -> aS | bS | a$$

Trivial thing:

starting and ending with a

Atleast 3 a’s are definitely present

(These are very layman observations…but seriously I am unable to figure out what exactly this language is all about. …) My attempt:

What I am able to generate

1)aaa

2)aAA

a bS A

a ba AA A

a ba ***

This suggests after b there should be atleast 1 a

*(Coz those *** have all

1. a’s

or

1. if bS used then again a ‘ba**’

Or

1. if aS used length also increases by atleast 3.)*

I know this is not a good analysis..and so I am not expecting any answer but would definitely expect some comments about some intuition or idea..plz any help would be much regarded..

(Although answers are always welcome 😉 )

## Are there context free grammars for all restricted Dyck paths?

A Dyck path is a finite list of $$1$$‘s and $$-1$$‘s whose partial sums are nonnegative and whose total sum is $$0$$. For example, [1, 1, -1, -1] is a Dyck path. Rather than use $$1$$ and $$-1$$, it is common to use "U" and "D" for $$1$$ and $$-1$$, respectively, so we might write UUDD instead. (These might be more familiar as Dyck words.)

It is well-known that Dyck paths have a standard "grammar." The "Dyck grammar" for a path $$P$$ is

$$P = \epsilon \quad | \quad U P D P.$$

This grammar is very useful because it lets us quickly compute the generating function which enumerates the number of Dyck paths of given lengths.

I am interested not in all Dyck paths, but restricted sets of Dyck paths. For example, consider the Dyck paths which avoid "peaks" (the bigram UD) at positive even heights; UUUDDD is such a path, while UUDD is not. If we could devise an unambiguous grammar for such paths, then we could write down an equation for the generating function which counts them. (There is such a grammar. It requires two production rules – one for the paths which avoid peaks at even heights, and one for paths which avoid peaks at odd heights.)

This idea leads to a natural question:

Given a (possibly infinite) set of positive integers $$A$$, does there exist a finite, unambiguous context-free grammar which generates precisely the Dyck paths whose peaks avoid $$A$$?

The answer (I think) is "yes" when $$A$$ is finite or an arithmetic progression. I suspect that the answer is "no" in every other case, but I have no idea how to begin proving this.

For example, here is a special case that I cannot decide:

Is the set of Dyck paths which avoid peaks at positive squares a context-free language?

Posted on Categories proxies

## closure of Context free grammer to homomorphism using PDA

I was looking online, on sipser book, and on lecture notes and I can’t find a proof to closure of context free languages to homomorphism that using PDA instead of CFG. I’m not looking for a full and formal proof, I just want to understand the general idea.

Posted on Categories proxies