Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

71–80 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#71
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/ ).

Not really, the meaning of debit and credit depends on the type of account That's how most accountants think about it. But I think there's something more fundamental: a CR entry is an increase is what the company owes (to creditors or shareholders), and a DR is an increase in what the company owns. EDIT: see this link for how this relates to the accounting equation https://news.ycombinator.com/item?id=32501707

That's (somewhat) true for accounts that represent stocks (assets, liabilities, not really for equity though), it's not true for accounts that represent flows (income, expenses). Income is recorded as a credit entry in an income account, eg (the corresponding debit entry would typically be on something like a current account or claims on customers).

Re: Double-entry bookkeeping as a directed graph

#72

Earlier quoted context omitted.

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?

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.

Re: Double-entry bookkeeping as a directed graph

#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 value between accounts.

- Every transaction must have at least two entries. The balance of all entries the transaction holds should be 0, i.e., balance = debits - credits.

You don't think about money leaving or entering an account before you nail down those definitions. The account representations can be anything that holds a numeric value, not just money.

You can affect more than two accounts by adding additional entries with the condition of keeping the balance to 0.

Re: Double-entry bookkeeping as a directed graph

#74
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?

> actually explain the "double" part in detail?

$100 appears in your account. That’s one part. The other part depends on why.

* you moved money from another account, the double is -100 in that account.

* you sold stuff, +100 in income.

* you borrowed some money, +100 in ‘debt’.

In a physical book each of these categories would have a left and right column, and each transaction has numbers in one left and one right column. Or in many columns but the sums of left vs right columns must be the same.

Re: Double-entry bookkeeping as a directed graph

#75
post #26

I believe double-entry bookkeeping needs more attention. I think double-entry bookkeeping is, at least to me, as fundamental to economics (and of course business) as logic to math. Even if some actors don't use it explicitly, it still holds. If I buy ten apples for 10 bucks, I have ten more apples in stock and ten bucks less. Many economic discussions (not only on HN) get out of hands because people don't try to see…

Agreed. The "magic" of double entry bookkeeping is that it is a financial version of the Principal of the Conservation of Energy.

It isn't as strict in that it allows for assets to alter in value, for profits or losses to be made. But it does keep track of the way that money and "value" circulates in different forms, e.g. as cash, assets, debts, depreciation, etc.

The "double entry" keeps track of the transformation of the nature of "value". This is hard to do using a simple household-style "cash-in" and "cash-out" set of accounts.

Re: Double-entry bookkeeping as a directed graph

#76

Earlier quoted context omitted.

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?

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)…

How do you determine which thing goes in which account, is it subjective or there is a formal way with a definition

Re: Double-entry bookkeeping as a directed graph

#77
post #39

Earlier quoted context omitted.

On the other hand some things in how accounting is traditionally done suffer from accounting predating a lot of "modern" math. Negative numbers were first used around the 3rd century in China and took until the 16th century to be used in Europe. Modern double-entry bookkeeping was invented in the 14th century in Europe. So if you ever wonder why they traditionally use a column for debit and one for credit, with defin…

I wonder if this is why losses are written down with () instead of -.

Yes, that's part of it. The lengths accountants will go to to avoid having to deal with negative numbers is a bit funny.

Re: Double-entry bookkeeping as a directed graph

#78
post #26

I believe double-entry bookkeeping needs more attention. I think double-entry bookkeeping is, at least to me, as fundamental to economics (and of course business) as logic to math. Even if some actors don't use it explicitly, it still holds. If I buy ten apples for 10 bucks, I have ten more apples in stock and ten bucks less. Many economic discussions (not only on HN) get out of hands because people don't try to see…

Economics is funny because its very anti complex math. For the local economics (household even company level) that makes total sense but for anyone doing research or systems modeling for things bigger than a company the total distain for calculus and non-equilibrium systems really prevents any discussion. I think its because if you remove stability most of supply and demand arguments fall apart. Its crazy because stable systems are extremely rare in natural complex systems its weird to apply it to large parts of economics as a given.

But here I'd caution against the idea that banks (not even central) cannot increase money supply because that's not really true. If a Bank is the backer of both sides of loans or engage in fractional reserve banks (i.e all banks), they can effectively increase money supply which in my opinion is equal to printing money. Especially since in the loan case, the loan is not necessarily a guaranteed asset (think cars in a crash). This effect is called the money multiplier effect via fractional reserve banking. https://www.youtube.com/watch?v=93_Va7I7Lgg

The multiplier is more of ceiling to the amplification rather than it actually happening on loans. None of this necessarily bad loans and investment are really important to other parts of economics but none of it is simple and non of it is stable in the traditional sense

Re: Double-entry bookkeeping as a directed graph

#79
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 not to double the amount of work to reduce errors. The point is to record both where money came from and where it went to. This simplifies analysis, reporting, etc. down the line.

The fundamental unit of a double-entry system is the transaction, which records from where things came and to where they went. In software parlance, it's an event-sourced system rather than the stateful/interactive system of single-entry accounting.

Re: Double-entry bookkeeping as a directed graph

#80
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.…

> But I grew up in a world where computers do all of the math, and it always looks to me like it's violating the Don't Repeat Yourself principle. If you say the same thing in two different places, one of them is always going to be wrong.

This is wrong on a couple of levels.

In your understanding do RAID disk arrays and backups violate “the Don’t Repeat Yourself principle”? Is one of the copies of the data guaranteed to be wrong? Do data backups duplicate data because of pre-modern thinking?

But on another level it’s irrelevant, because in double-entry bookkeeping, there is no duplication of information. If you buy an apple for a dollar, your journal entry will mark a dollar out of cash — which is true because you now have 1 less dollar — and a dollar against your “Food” expense account — which is true because the thing you just spent a dollar on was food. If you took away either entry, you would be losing information. The fact that both entries have to balance isn’t because of duplication, it’s because the same dollar can't exist in more than one place at a time, which is axiomatically true regardless of whether you use a computer.

Post reply on HN