Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

171–180 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#171
post #147
post #145

Earlier quoted context omitted.

> The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account I find it easy to just think of debit as adding to the left and credit as adding to the right. Their definitions are always the same that way.

But that just begs the question because you have to remember the arbitrary assignments of what things go on the left and what things go on the right.

It's the accounting equation being represented in canonical form. A chart of accounts is visualized in the minds of an accountant as:

Assets | Liabilities + Equity

Accounts classified as assets are debit accounts (left side), and accounts classified as liabilities or equity are credit accounts (right side).

The theory discussed everywhere in this thread is sound. You really don't need to use terminology like debit/credit for accounting.

What the discussion misses is the application of this framework. It is useful for a human to be able to visualize a complex transaction and work through missing pieces with the hints this framework provides. I'm missing something on the left? Oh yeah, I missed the deferred revenue debit.

Re: Double-entry bookkeeping as a directed graph

#172
I built a double-entry ledger for multiple different kinds of credit cards at redcarpetup. the way i like to primarily think of it technically is idempotency. Thinking of balances is the wrong way to model it :

1. since you want the capability to recompute all balances using ledger entries. 2. there are not two balances. There's usually a lot more. you want to update reward points, dues, late fees, partner share, etc etc etc. a 2 balance double entry ledger is a simplification.

once you set your mental model to think of it as a idempotency problem, there are multiple ways to model it. For e.g. a directed graph - traverse the entire subgraph to update balances. Or model it as a log database and re-run txns to arrive at balance computation.

Re: Double-entry bookkeeping as a directed graph

#173

I think I'm missing something here. How does looking at transaction history as a directed graph help anything? Is it an improvement on the centuries-old "double-entry" practice? It seems to barely work with the toy example of couple transactions - imagine what the graph would look like with dozens or hundreds of edges between pairs of nodes. What use would there be for the typical algorithms that work with graphs? Th…

I can see what you are saying, but I think it helps in two ways:

1. it is another way to conceptualize an idea. For most purposes this might not be relevant, but who knows where a hard accounting problem might be resolved through the application of graph theory (or the inverse!).

2. it is another way to visualize flows. Not everyone is financially literate or numerically inclined, so instead of handing them a table of columns of numbers and having them reason about the flows numerically, it lets you represent the flows spatially which maybe easier. After all, not all tools are for professionals.

Additionally, while the cumulative history in one graph might be much, simply adding filters based on transaction date might provide non-obvious insight that other visualizations miss. I can see this probably being even more helpful by cross referencing other information such as location.

Re: Double-entry bookkeeping as a directed graph

#174

Earlier quoted context omitted.

> The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing What would you suggest as an improvement? The article suggests "incoming" and "outgoing" which seems to have the same issue, as does everything I see in your comment (the person spendin…

When I talk to accountants, I get confused with debit/credit so I use "increase" and "decrease". Everyone seems to understand me fine. For example, "Decrease cash", to buy equipment "increases assets". "Increase cash" by borrowing money is "increasing liability".

Indeed, the dirty secret is that many accountants think of debit and credit as decrease and increase as well. After using the terms for a little while they switch the symbol (word) they think of, but it still retains the same meaning. They are basically synonymous.

source: friends and family members who are accountants and have generously given free bookkeeping tutorials

Re: Double-entry bookkeeping as a directed graph

#175

Earlier quoted context omitted.

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

> 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. QuickBooks absolutely is a double-entry accounting system. The "bookkeeper" mode abstracts away and hides what's going on under the hood, but if you enter "accountant" mode, you'll see the full ledger, and you can even make direct journal entries to modify it…

I must have only ever encountered it in "bookkeeper mode". That abstraction is likely what threw me off!

Re: Double-entry bookkeeping as a directed graph

#176

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?

From what I got out of the article and my own limited understanding of double entry bookkeeping, the "double" seems to be referring to the part where we split a transaction into credits and debits as opposed to a transaction with positive or negative balance. The doubling is happening with the labels we use to describe what's happening with the money. From an individual account perspective, there's a doubling of the…

this is probably not true, but I heard that this stuff predates the idea of negative numbers so you have db and cr accounts that offset each other without negatives.

Re: Double-entry bookkeeping as a directed graph

#177
David P. Ellerman has a mathematical approach to accounting based on what he refers to as the Pacioli group. A provisional element of the Pacioli group looks like x//y where x and y are non-negative integers and we form equivalence classes based on x//y and u//v being equivalent if the cross sums x+v and y+u are equal. The group operation is x//y + u//v = (x+u)//(y+v) and the inverse of x//y is y//x . The identity element is 0//0. For more info see, for example, https://ellerman.org/wp-content/uploads/2012/12/DEB-Math-Mag...

Re: Double-entry bookkeeping as a directed graph

#178

Earlier quoted context omitted.

When I talk to accountants, I get confused with debit/credit so I use "increase" and "decrease". Everyone seems to understand me fine. For example, "Decrease cash", to buy equipment "increases assets". "Increase cash" by borrowing money is "increasing liability".

Indeed, the dirty secret is that many accountants think of debit and credit as decrease and increase as well. After using the terms for a little while they switch the symbol (word) they think of, but it still retains the same meaning. They are basically synonymous. source: friends and family members who are accountants and have generously given free bookkeeping tutorials

>Indeed, the dirty secret is that many accountants think of debit and credit as decrease and increase as well.

So how would you correctly express the parent's example in terms of debit/credit if debit/credit are synonymous with decrease/increase?:

>>"Increase cash" by borrowing money is "increasing liability".

"Crediting cash by borrowing money is crediting liability" would sound obviously incorrect to any accountant.

Re: Double-entry bookkeeping as a directed graph

#179

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…

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…

Having separate debit and credit amounts (instead of a single positive/negative number) serves another purpose as well: To track the total amount added or deducted from each account.

Re: Double-entry bookkeeping as a directed graph

#180

Double-entry bookkeeping is very easy to understand once you ditch the ridiculous "credit" and "debit" terminology. Essentially, the goal is to keep the accounting equation true at all times. The equation is: Equity = Assets - Liabilities. Eventually, earnings (Income - Expenses) will become part of equity, so splitting that out, you have: Equity + Income - Expenses = Assets - Liabilities. Rearranging to get rid of t…

> The "credit" and "debit" terminology is ridiculous because their definitions swap around depending on which account you're talking about, which is an utterly absurd (mis)use of language and the main reason people find this confusing.

As a neophyte: "credit" and "debit" make me think I'd need both entries to do books at all.

The way you've written it makes me think: "Oh, this is just single-entry accounting for people who aren't careful like me!"

So perhaps historically there was value in misusing terminology sufficiently to cause people to people turn off the optimizing compiler in their brain so that they just learn and do it correctly from the beginning?

Edit: clarification

Post reply on HN