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

Proposed solution for thirsty men problem #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matingnet
Copy link

This pull request solves the Thirsty Men Problem by shuffling cups, using encryption for secure placement, and validating the process to ensure fairness. It promotes cooperation and fair distribution of responsibilities, with a simulation demonstrating the process for three players.

Signed-off-by: matingnet <medaymanedhimni@gmail.com>
@bellaj
Copy link
Owner

bellaj commented Dec 26, 2024

@matingnet interesting answer but a major problem is not handled. The last holder can just refuse to put the last cup because his cup was put before and if he does the winners will get the water and not him why would he end the process?

@matingnet
Copy link
Author

@bellaj Thanks for bringing this up! To fix the issue of the last holder potentially refusing to place the final cup, I’d suggest having everyone place their cups at the same time after encrypting their positions. If two players end up picking the same spot, the pourer can step in during the encryption phase, check the values, and ask the guest to redo their calculation until there’s no conflict. This way, we keep things fair and avoid any disruptions.

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