The ‘Two Generals’ problem


Tom Scott explains what is known as the Two Generals problem in computer information theory, something that I had never heard of before, and how it can have real world implications, such as a recent case where the lack of awareness of the need to address this problem led to a food delivery company sending multiple orders to the same addresses.

Comments

  1. Bruce says

    Earlier this year, I had this problem when renewing a monthly payment on a cell phone. I ended up paying for three renewals in a half hour, which gave me lots of cell data, which will likely expire before I use it all, because it expires if I don’t buy more each month.
    It turned out in my case not to be this exact problem. Instead, my credit card was waiting to verify my authorization for paying a (foreign) phone company when I was in the USA. All was solved, but not before I panicked and paid three times to do a monthly renewal. Live and learn. Sometimes, the only error is the error message that you have received under slightly false circumstances. Technically true, but very misleading to the user me.

  2. mailliw says

    As Tom Scott points out, the problem lies with fundamental design errors in the system.

    But maybe the problem goes deeper than that? I work in data management and I am frequently shocked by the lack of foundation knowledge among many people working in IT.

    The area that Scott is talking about is transaction control and concurrency. In short, when a transaction takes place the system has to make sure that it is either completed in its entirety or not at all. This ensures the logical consistency of the data. Recently there has been a spate of companies offering products that dispense with the “overhead” of transaction control (it slows down performance). The customer then has the “advantage” of getting the wrong answer at lightning speed.

    There are other possible causes of duplicate orders. In the mathematical definition of the relational model of data, all data is represented as sets. The worldwide standard for querying data is SQL a query language that can return duplicate data (the result is not a set, it’s a bag). Thus an incorrectly written query can generate the same order many times (potentially several thousand or million times). I’ve seen this happen in the real world, so it is very, very far from being a purely theoretical problem.

    This is why you should never believe the tech companies stories of “exponential advance”. They can’t even seem to fix fundamental logical bugs in their products.

  3. machintelligence says

    A major cell phone provided has this problem and has not corrected it after nearly a year. I get a text message that my payment has been made by autopay, followed in a few minutes by another text informing me that autopay has failed. In never has, so I now ignore the second message.

Leave a Reply

Your email address will not be published. Required fields are marked *