Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Oops.] Incorrect definition of a conservative string. #285

Open
syedtaz opened this issue Feb 1, 2024 · 0 comments
Open

[Oops.] Incorrect definition of a conservative string. #285

syedtaz opened this issue Feb 1, 2024 · 0 comments

Comments

@syedtaz
Copy link

syedtaz commented Feb 1, 2024

Please verify that the error is present in the most recent revision before reporting.

This is the version of the notes linked on the front page of Algorithms.

Chapter number or note title: Strings, Models of Computation

Page number: 16

Error description:

Question 27 states the following definition of a conservative string and asks us to show that a conservative string is equivalent to a balanced string.

A string w ∈ {0, 1}* is conservative if it satisfies both of the following conditions:
– w has an equal number of 0s and 1s, and
– no prefix of w has more 0s than 1s.

However, consider the string w = 0011. This is a balanced string since w = 0x1 where x = 0y1 where y = e. However, this string is not conservative since (a) it contains an equal number of 0s and 1s but (b) 00 is a prefix of 0011 but it has more 0s than 1s.

Suggested fix (if any):

I believe the second condition in the definition of a conservative string should be "no prefix of w has more 1s than 0s"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant