Skip to content

Update josephus_improved.py #3

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

Merged
merged 1 commit into from
Jun 7, 2019
Merged

Conversation

luiz-surian
Copy link
Contributor

The equation to the Josepus problem, W(n) = 2L + 1, has a constraint in which L < 2^a (The biggest power of 2 inside the number of soldiers, in this case the variable p).
This means if n is a power of 2, the winning position will always be 1, so the formula would be wrong.

The equation to the Josepus problem, W(n) = 2L + 1, has a constraint in which L < 2^a (The biggest power of 2 inside the number of soldiers, in this case the variable p).
This means if n is a power of 2, the winning position will always be 1, so the formula would be wrong.
@devAmoghS devAmoghS merged commit cb713c1 into devAmoghS:master Jun 7, 2019
@devAmoghS
Copy link
Owner

Thank you for you contribution @luiz-surian

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

Successfully merging this pull request may close these issues.

2 participants