Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

81–90 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#81
post #73

This is my mental model and how I built the backend of a budgeting web app. Two types of accounts: - assets (you want your balance to be more than 0) - liabilities (you want your balance to be 0) Two types of entries: - debits (increase balances of assets, decrease balances of liabilities) - credits (increase balances of liabilities, decreases balances of liabilities) Rules: - A transaction represents a transfer of v…

Given just the two accounts you have, your goals are impossible to achieve, because Assets = Liabilities, so you cannot have one more than zero and the other zero.

I think in this problem hides two mistakes:

- Zero liabilities is not a reasonable goal for most people.

- There's an equity account type also. (Also income and expense accounts.)

Re: Double-entry bookkeeping as a directed graph

#82
post #16

I find it a strange choice to explain double-entry bookkeeping with the example of "one entry for Alice, one entry for Bob". That's really not what it's about. It's obvious that a transaction with two parties could be recorded in two places, but to me the crucial point of double-entry bookkeeping is that it requires two entries for each party of the transaction . So if Alice buys book from Bob, four entries are made.…

Every explanation of double entry accounting seems to do the same thing. If I'm trying to understand the double part of double-entry bookkeeping, what exactly does the "double" refer to? What's being "doubled"? How would you salvage the article to actually explain the "double" part in detail? Could you do it purely from Bob's (or Alice's) perspective?

It’s a checksum; by decomposing every transaction into a double of (credit A, debit B) that must sum to zero, you catch random arithmetic errors.

You can think of it as “conservation of value”, so you can’t just create money out of thin air in your payment service (credit), without tying it to some account with a corresponding debit.

This originally was intended to protect against typos; eg write a 10 instead of 100, at the end of the day your ledger needs to balance. In software typos are less likely bit it still provides auditability to prevent a large class of bugs from wiping you out.

Re: Double-entry bookkeeping as a directed graph

#83
post #48
post #32

> Definition 6: Credit An entry that represents money leaving an account. > Definition 7: Debit An entry that represents money entering an account. Not really, the meaning of debit and credit depends on the type of account: https://en.wikipedia.org/wiki/Debits_and_credits Maybe there's a reason why it takes more than one course to become a CPA ( https://www.accounting.com/careers/cpa/how-to-become/ ).

Every time I look at accounting, the different kinds of accounts baffle me. I can never keep straight what each kind of account is used for, or which ones have positive credits and which ones have negative credits. As far as I can tell, the point is to double the amount of work in the hopes of catching certain kinds of errors. Which makes sense when you have humans making the entries and humans doing the arithmetic.…

> the point is to double the amount of work in the hopes of catching certain kinds of errors

That's also how I like to think about it, as a kind of checksum mechanism. Double-entry bookkeeping originated in medieval European markets, which were often open-air, noisy, dirty, full of thieves and other dangers. Keeping your records straight in that environment must be a challenge, and having a logic that allows you to catch some mistakes can be a powerful tool in that context.

But there's more to it, eg it allows you to make a distinction between expenses and investments, so it is actually a truly different way to think about your financial situation than eg looking at cash flows only. Spending X on a buying livestock has a different economic meaning than spending X to pay a security guard. There are economic historians who argue that this kind of perspective was an enabler of early capitalism, because it enables people to see that money spent on an investment isn't lost value.

Re: Double-entry bookkeeping as a directed graph

#84
This is a great write up, thank you! One thing I’m curious about is what properties/metrics of the graph mean for accounting. Spectral properties (eigenvalues, etc…) might have some insightful meaning for the financial system.

Also I’m sure this is extremely well studied but I’m not super familiar — ML on accounting graphs could identify shapes that indicate illegal transactions, etc… Will dig for reading :)

Re: Double-entry bookkeeping as a directed graph

#85
post #72

Earlier quoted context omitted.

Remember, this was all done on paper before software with tagging and such existed. I'll give a description shot, since I've been doing finance work recently. Other people can feel free to correct. A company using double entry (as opposed to single) has a "chart of accounts." This means they have a bunch of imaginary accounts for tracking everything, including: - Assets (e.g. cash on hand.) - Liabilities (e.g. loans)…

> this helps with important finance reports [...] since you can now see how money is moving around. This is the real benefit I've encountered. Any time I try to "simplify" financial recording for someone else and avoid double-entry, I inevitably end up wanting to perform a query that would be easy in a double-entry system but is not in any other system.

Right. I didn't mention that a chart of accounts can look different in different companies/sectors. Some accounts may be considered nested (software may even show them as nested.) Then you can roll the totals for all accounts of a type into a general category account like "Assets" or "Expenses." That makes it easier to answer questions like, "how much have we spent in total?"

Re: Double-entry bookkeeping as a directed graph

#86

I think people underestimate the beauty and impact of accounting. Just a tiny number of formulas (accounting identities [1]) and statements (P&L, balance sheet, etc.) can represent what's going on in any org in ways that can be roughly comparable. Reminds me of the "fundamental theorem of calculus" or "central dogma of biology". Accounting is also where we get math and written language [2] as ancient Mesopotamian civ…

I know people underestimate the impact. Before the 1800s or so Europe didn't have negative numbers, except for the odd mathematician who claimed you could calculate with them even if they were obviously meaningless.

It was only after bookkeeping became ingrained into all levels society that negative numbers were considered equally real as positive numbers.

Re: Double-entry bookkeeping as a directed graph

#87
post #58
post #16

I find it a strange choice to explain double-entry bookkeeping with the example of "one entry for Alice, one entry for Bob". That's really not what it's about. It's obvious that a transaction with two parties could be recorded in two places, but to me the crucial point of double-entry bookkeeping is that it requires two entries for each party of the transaction . So if Alice buys book from Bob, four entries are made.…

In all fairness, if you're trying to understand a piece of software like Quickbooks and are not coming from an accounting background, anthropomorphizing each "account" at your company as an individual actor with their own ledger can actually be a helpful mental model. Everything needs to be a dance between actors, and, for instance, when you make a vendor payment in cash, you can only do so as a message sent simultan…

>Double-entry, I suppose, means each event must be ingested exactly once by an even number of actors.)

No, the number of accounts (actors) does not have to be even. The sum of debits and credits has to be equal (or zero if you like).

Re: Double-entry bookkeeping as a directed graph

#88
post #16

I find it a strange choice to explain double-entry bookkeeping with the example of "one entry for Alice, one entry for Bob". That's really not what it's about. It's obvious that a transaction with two parties could be recorded in two places, but to me the crucial point of double-entry bookkeeping is that it requires two entries for each party of the transaction . So if Alice buys book from Bob, four entries are made.…

Every explanation of double entry accounting seems to do the same thing. If I'm trying to understand the double part of double-entry bookkeeping, what exactly does the "double" refer to? What's being "doubled"? How would you salvage the article to actually explain the "double" part in detail? Could you do it purely from Bob's (or Alice's) perspective?

Every time money is exchanged, it has to come from somewhere and it has to go somewhere -- that's two places it need to be recorded (or "entered in the books").

Money can not be created out of thin air, and it can not be destroyed. Every movement of money has to be accounted for, which is why it's called "accounting". Double-entry accounting means you have to account for where the money comes from, and you have to account for where it goes, and each of those is a separate entry and it all has to add up to zero.

Where it can become confusing is when money leaves you or comes in from an external source. There are still two entries, but one entry is in one party's books and the other entry is the other's. For example, I get a paycheque and I enter my income in a little book with green paper and DB/CR columns. At the same time, my employer has entered an expense in their book. Double entries.

Re: Double-entry bookkeeping as a directed graph

#89
post #58

Earlier quoted context omitted.

In all fairness, if you're trying to understand a piece of software like Quickbooks and are not coming from an accounting background, anthropomorphizing each "account" at your company as an individual actor with their own ledger can actually be a helpful mental model. Everything needs to be a dance between actors, and, for instance, when you make a vendor payment in cash, you can only do so as a message sent simultan…

> if you're trying to understand a piece of software like Quickbooks and are not coming from an accounting background Unfortunately, QuickBooks won't help you understand accounting. It's not a true double-entry accounting system, at least it wasn't the last time I touched it. That said, it still does its job and does it well enough, and real accountants are fine with dealing with it. Simply Accounting is a better exa…

> It's not a true double-entry accounting system, at least it wasn't the last time I touched it.

Can you elaborate? I've used Quickbooks for over 15 years and it has always been a true double entry accounting system during that time.

Re: Double-entry bookkeeping as a directed graph

#90

Everyone should do their own accounts. I've been doing it for over 12 years and I'm so glad I've kept up with it. I don't bother keeping my ledger immutable, though. The point about immutability is that whatever happened is immutable (because it's in the past; it already happened!) and the ledger should just reflect that. So if I somehow made a mistake in my ledger I just correct it. I keep my ledger in git so that d…

What does that mean? Are you using cash? Are you copying bank transaction history to your git?
Post reply on HN