So I am a newbie computer science person and would like some help from the community in helping me understand this subject.
I have this regular language I am trying to determine is 3 things from this language: DOUBLE = {w | w contains twice as many 0s as 1s}
- NOT regular
- context-free
- decidable
My thinking for each is that
it's not regular because of the Pumping Lemma. Assume for the sake of contradiction, that DOUBLE is regular. If we were to use string \(0^n1^n\) then for the three conditions.
|xy| ≤ n|y| > 0- For all integers i ≥ 0, the string
xy^izis also in L. When applied the Pumping Lemma doesn't not work
is context free because if we use a context-free grammar (CFG) that look like S -> 0S1S | ε generates strings that have twice as many 0s as 1s
is decidable because it contains twice as many 0s as 1s