How do you split coins to match heads?
Problem Description
You are presented with N coins on a table. You are informed that exactly H of these coins are currently heads-up, but you do not know which specific coins are heads-up.
Your task is to devise a strategy to divide these N coins into two distinct piles such that both piles contain the exact same number of heads-up coins. You are permitted to flip any coin(s) you choose during this process.
Describe a strategy that guarantees success under all valid conditions and provide a clear justification for why your strategy always works.
AI interview prep
Core dilemma
Transforming a system with an unknown internal state (which specific coins are heads-up) into a desired, balanced state (equal heads in two piles) using only operations that don't require direct observation of the initial unknown state.
2 tradeoffs and 2 stress tests locked
Interview prep
Unlock the interviewer X-Ray rubric, tradeoff matrix, stress tests, clarifying questions, and key concepts.
How do you split coins to match heads?
Problem Description
You are presented with N coins on a table. You are informed that exactly H of these coins are currently heads-up, but you do not know which specific coins are heads-up.
Your task is to devise a strategy to divide these N coins into two distinct piles such that both piles contain the exact same number of heads-up coins. You are permitted to flip any coin(s) you choose during this process.
Describe a strategy that guarantees success under all valid conditions and provide a clear justification for why your strategy always works.