Money Orders

Join Our Community of Science Lovers!

In many countries, people consider their salaries to be a closely guarded secret. But that makes them all the more curious about where they stand in their enterprise's salary ordering. Let's see if we can help them find out without their losing too much privacy.

There are some number of employees whose salaries are known to be between x and y. You, as a trusted outsider, ask questions of the form "Who has salaries between s1 and s2 inclusive?" The employees agree to answer honestly. At the end, you will tell them the order of their salaries (or they will be able to figure it out, because they are listening to the questions and answers). So they don't get nervous, you want to ask as few questions as possible. Nobody cares about the order among any subgroup of people if their annual salaries are within $5,000 of one another.

Warm-Up:
There are five people and you have found out that Nick and Jeff earn in the interval between $0 and $50,000. In addition, you find out:
$40,000 - $60,000: Jeff and Ariana
$50,000 - $80,000: Ariana, Carol, Joe


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


How many more questions do you need to find the full order among these five people?

Solution to warm-up:
Two more questions. You already know that Nick earns the least, then Jeff, then Ariana. Ask who earns between $60,000.01 and $70,000. If neither Carol nor Joe, then ask about $70,000.01 - $75,000. If both Carol and Joe are in that higher interval, then you don't care how they are ordered. If not then they earn more than $75,000 and we still don't care. If one of Carol and Joe earns between $60,000.01 and $70,000, then the other earns more and you have your answers. If both earn between $60,000.01 and $70,000, then ask about $65,000.01 - $70,000.

Now here are some challenges for you.

Problems:

1. Suppose there are 10 people who earn between $0 and $200,000. Order them according to the above rules using as few questions as possible. (Hint: my best answer was about 20.)

2. What if there are only 4 people earning between $0 and $200,000? How does that change your strategy? (Hint: my best answer was about 10 questions.)

3. How many questions do you need if there are 4 people earning between $0 and $2,000,000?

4. Can you find an approach to the general problem?

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe