Closed Abhilekhgautam closed 1 year ago
How does S -> a S b S | b S a S | epsilon has equal number of a and b?
S -> a S b S -> a a S b S
Now if I used an empty string I'd get 2 a's and 1 b's.
my bad.. made a bluneder S -> a S b S -> a a S b S b S
so we have same number of a's and b's.
How does S -> a S b S | b S a S | epsilon has equal number of a and b?
Now if I used an empty string I'd get 2 a's and 1 b's.