miltonbradley
New member
- Joined
- Sep 26, 2006
- Messages
- 1
Ok, I've been staring at this problem for hours, but can't figure it out. It concerns finding a formula describing a language.
The language is defined over the alphabet {0, 1} with an equal number of 0s and 1s, and any prefix of a string in the language has at least as many 0's as 1s.
Example of prefixes for swimming:
s
sw
swim
swimm
swimmi
swimmin
swimming
Some strings in the language:
01
0011
0101
010011
010101
001101
001011
000111
This problem is similar to another problem which is much easier to solve:
The language is defined over the alphabet {0, 1} with an equal number of 0s and 1s, and all 0's are before all 1s.
so the formula would be x = 0^M 1^M
where 0^3 1^3 = 000111
Any tips or help would be appreciated. Thanks.
The language is defined over the alphabet {0, 1} with an equal number of 0s and 1s, and any prefix of a string in the language has at least as many 0's as 1s.
Example of prefixes for swimming:
s
sw
swim
swimm
swimmi
swimmin
swimming
Some strings in the language:
01
0011
0101
010011
010101
001101
001011
000111
This problem is similar to another problem which is much easier to solve:
The language is defined over the alphabet {0, 1} with an equal number of 0s and 1s, and all 0's are before all 1s.
so the formula would be x = 0^M 1^M
where 0^3 1^3 = 000111
Any tips or help would be appreciated. Thanks.