Skip to content

a solution for the thirsty_men_problem#47

Open
xarafeddine wants to merge 2 commits into
bellaj:masterfrom
xarafeddine:master
Open

a solution for the thirsty_men_problem#47
xarafeddine wants to merge 2 commits into
bellaj:masterfrom
xarafeddine:master

Conversation

@xarafeddine
Copy link
Copy Markdown

@xarafeddine xarafeddine commented Apr 9, 2025

a solution for the thirsty_men_problem

@xarafeddine xarafeddine changed the title I proposed solution for the thirsty_men_problem a solution for the thirsty_men_problem Apr 9, 2025
Signed-off-by: Mohamed Charaf eddine Ait ougrram <75548822+xarafeddine@users.noreply.github.com>
@bellaj
Copy link
Copy Markdown
Owner

bellaj commented Apr 10, 2025

first host should not be involved
second the proposed enforcement Mechanism:

"Any guest who deviates from the rotation is excluded from all future rounds
Since water is a vital resource, this creates a strong incentive to cooperate"

is flawed! if we could apply such rule why not just ran a dice and force people to put their cup!
besides people with 1st and last cup in first rounds why would they cooperate! they can just drink their water and block second round

@xarafeddine
Copy link
Copy Markdown
Author

Forget about rounds,
They should distribute the limited water evenly.
To ensure fair water distribution, the guests agree that the two in the first and last positions must share their cups equally among all. To prevent cheating, these guests deposit something valuable (e.g., an item or promise worth up to a cup’s value) as collateral, which they only reclaim after fulfilling their sharing obligation. This binding commitment, enforced by mutual interest and potential penalties, guarantees cooperation, ensuring everyone receives 2/N cups without deadlock.
o salam

@bellaj
Copy link
Copy Markdown
Owner

bellaj commented Apr 19, 2025

To prevent cheating, these guests deposit something valuable (e.g., an item or promise worth up to a cup’s value) as collateral, which they only reclaim after fulfilling their sharing obligation.

Who would manage the deposit?

@xarafeddine
Copy link
Copy Markdown
Author

To ensure a fair and self-regulating distribution of the limited water, the guests agree to use money - or something similarly valuable, like bitcoin :) - to represent the value of a cup of water. The two guests who manage to place their cups in the first and last positions—the only ones that will be filled—must commit to sharing their water in exchange for compensation.

Each of these two "prime position" guests offers just the value of their cup as a form of collateral. But instead of handing this money to a third party, the system works without a central monitor or controller.

Here's how: each of the two prime guests individually negotiates with the remaining N-2 guests. In return for a fair portion of their water (which is 1 / (N-2) of a cup), they receive a proportional share of the cup’s value in money—specifically, (1 / (N–2)) × [cup value].

This peer-to-peer exchange ensures that each prime guest recovers the full value of their cup by the end, and each guest receives their fair share of the water. Because every transaction is handled directly and independently, no trust is required in a central authority—only in rational self-interest.

Example Walk‑Through (N = 5)

  • Guests: A, B, C, D, E
  • Random‑draw result: A in spot 1, E in spot 5.
    Collateral V: Agreed at $1 per cup.
  • Exchanges:
    A sells 1/3 cup to B, C, D for $0.333 each.
    E does the same.
  • Settlement:
    B, C, D each pay $0.333 to the contract and receive their cup‑shares.
  • Contract releases $1 total back to A, and $1 back to E.

Q&A:
Why Will They Cooperate?

  • Economic Incentive: Every non‑prime guest gets water without risk, and the prime guests recoup exactly their cup’s value.
  • No Central Authority: The system is self‑enforcing—each exchange is atomic (water ⇄ money), using either micropayments or crypto escrow.
  • Rational Self‑Interest: Cheating means losing collateral or being cut off from the only water source; honesty maximizes each player’s payoff.

How to estimate “Value of a Cup” (V)

  • Market Reference: Agree on a local price benchmark (e.g., bottled water costs $1 per cup in the nearest store).
  • Pre‑Game Auction: Let all N guests bid their maximum willingness to pay; the median bid becomes V.
  • Consensus Round: If bids vary wildly, take the average of the middle third of bids to avoid outliers.

How to Prevent Cheating & Deadlocks
They can use technology in generale (for example blockchain-tech)
( to be honest I don't know much about these techs )
Escrow/Smart Contract: Collateral V is locked in a contract that only releases funds when either:
A signed, time‑stamped receipt of water is submitted.
A deadline passes, penalizing non‑compliance by forfeiting collateral.

Atomic Swap: Use hashed time‑locked contracts (HTLC) so that either the water is received and payment released, or everything reverts.

Commit‑Reveal for Receipts: Guests first commit to a receipt hash on‑chain, then reveal after receiving water, preventing repudiation.

Timeout Mechanism: If a guest stalls beyond X days, the smart contract automatically refunds collateral to the prime guest and releases nothing to the staller.

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