TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Stochastic, Nerdtastic Restaurant Bill Splitting

33 pointsby scottkrageralmost 13 years ago

14 comments

chimealmost 13 years ago
Why is the bill-splitting problem so much more interesting to techies compared to the tons of other real-life math application problems out there? I see more apps and websites on how to split a bill n-way than I see for predicting cashflows, organizing tables/chairs, and maximizing toothpaste usage combined. I think it is a fun problem as any other, but what makes it more interesting than others?
评论 #4259727 未加载
评论 #4260781 未加载
morschalmost 13 years ago
Where I live, it's very widespread and perfectly acceptable to pay exactly what you owe, especially if you're drinking/dining with peers. Waiters typically ask if you want to share a common bill or if you want to pay separately; if it's the latter they'll do the adding up for you.
评论 #4261151 未加载
评论 #4260168 未加载
评论 #4260244 未加载
AlisdairOalmost 13 years ago
With good friends I generally just split the bill evenly, but that tends to be non-scalable.<p>One method I found which seems to work quite nicely is each person puts in what they think they owe, and any difference between that and the total bill is split evenly between the group. This tends to work out nearly-equitable and is very fast.
评论 #4260375 未加载
calinet6almost 13 years ago
Appropriately, "Expectorant" also refers to a medication which helps produce mucus. This is roughly the social equivalent.
aaronblohowiakalmost 13 years ago
The (unfair) credit card roulette that they mention is a more "baller" version of this, and a favorite around certain groups of friends.
评论 #4260366 未加载
dreevesalmost 13 years ago
Excerpt that describes the actual mechanism:<p>Start with any item on the bill. The person who ordered that item pays the bill with probability equal to the cost of that item divided by the subtotal. Flip the appropriately biased coin; if that person is it, then you're done. If not, then subtract that item from the subtotal and repeat, recursively, with another arbitrary item. If you start with expensive items then you'll probably find the person who's paying after a handful of items, but it doesn't matter for fairness what order you pick things in. You won't have to figure out all the confusing drinks and appetizers (yet the outcome is as fair as if you had!).
评论 #4259708 未加载
评论 #4260319 未加载
brokentonealmost 13 years ago
TL;DR - This is not splitting the bill, but rather a gamble of paying the entire bill with a probability equal to your share of it.
评论 #4260864 未加载
dmvaldmanalmost 13 years ago
This makes me start thinking what other problems can be handled more efficiently if everyone agreed to be satisfied with an "expectation" of fairness in the long term.<p>You gain efficiency, at the loss of acquiring short term risk. Might be a useful exchange in some cases.<p>One good example: in a traffic jam everyone decides to maintain a minimum of 50ft between them and the car in front of them.
meddlepalalmost 13 years ago
I usually just pay what I owe and a 15 - 20% tip. Occasionally, and it depends on the acquaintances/friends. I am with, I will do equal split (total + tip) / number of people.<p>Is this really that difficult?
renwickalmost 13 years ago
Note the dreadful UI on their app implementation! (You type something like '100:5,25,60' and invite someone to guess a number on each round)<p>Why wouldn't they do something like:<p>1. Enter the subtotal (becomes permanently printed at the top) 2. Enter successive item amounts, after each entry the app says 'pay' or 'continue'
评论 #4260007 未加载
seivanalmost 13 years ago
I solved this recursively, but with a different algorithm... will try this out now :) Looks like fun!
评论 #4259963 未加载
lmmalmost 13 years ago
I find it hard to believe this would be faster than just adding up what everyone ordered, and then either picking someone with weighted random (absolutely equivalent to the given algorithm), or just everyone paying for their own stuff (perfectly fair).
评论 #4259958 未加载
fatbatalmost 13 years ago
All that math just complicates the roulette-ness.<p>How about just toss all the credit cards in a bag/box/etc and ask your nice waiter to pick one at random.
paulsutteralmost 13 years ago
I have an even better idea. How about anyone who thinks this is even marginally interesting just leaves me out of their dinner plans.<p>There are only two ways to take care of the check. Either one person pays, or n people pay equally like the opening scene in American Psycho. Any sort of bookkeeping at the dinner table is really bad manners.<p>EDIT, more etiquette hints:<p>when looking at the check, make at most a quick glance. Ideally don't look at the check at all. If you can't trust them to prepare a check you probably shouldn't trust their cooking either.<p>How do you figure out who picks up the check?<p>- if you are dining with the boss, you're the one who pays<p>- if you're dining with customers, you're the one who pays<p>- if you're dining with your girlfriend and her female friends, you're the one who pays<p>- if you're the host in any sense, you're the one who pays<p>- if you're dining with students and you're the only one who has a job, you're the one who pays<p>- if you're the one who went deep on the wine list, you're the one who pays<p>There aren't many times that a check gets split, or any sort of turn-taking applies. For the most part, you're the one who pays.
评论 #4259914 未加载
评论 #4259774 未加载
评论 #4259771 未加载
评论 #4260223 未加载
评论 #4260367 未加载
评论 #4260017 未加载