Live data from Hacker News

Double-entry bookkeeping as a directed graph

matheusportela.com

351–360 of 388 posts

Re: Double-entry bookkeeping as a directed graph

#351
post #348
post #317

Earlier quoted context omitted.

I agree generally speaking, but what does that have to do with your local books? Nothing. You almost certainly don't have access to your employer's books. Also, the ledger entries for "bregma, services rendered" i.e. payroll will be much more complicated than that, there will be taxes, deductions, etc they have to account for as well.

> what does that have to do with your local books? It's how double-entry bookkeeping works. Money can neither be created nor destroyed. On your local books you have an account where money goes and appears to be destroyed, but in reality there is a doubled entry in someone else's books. Just because you're unaware of it does not mean it does not exist. And it's true that bookkeepers will have splits in their ledger in…

The fact that you have a counterparty with his own books has nothing to with the phrase “double-entry accounting”, it is a method of keeping your own books.

Re: Double-entry bookkeeping as a directed graph

#352
post #126
post #113

Earlier quoted context omitted.

What if your company decides to be generous and just gave 1000 to random Joe, what is the double entry for that?

Cash account is credited $1000, and Gifted (or Cash_Gifted) account is debited $1000.

Gifted is an Income or Revenue account

Re: Double-entry bookkeeping as a directed graph

#353

Earlier quoted context omitted.

That method only works if money can be created out of thin air, and also destroyed. The grandparent comment was pretty clear that money cannot be created out of thin air, nor can it be destroyed. A curious contradiction. How do we resolve it?

While money can’t be created or destroyed (unless you run a central bank…), value can be. Ledgers always have a specific perspective, and that perspective can assign a different value to something than someone else. In the case of gifting something, from the perspective of the gifter, they destroyed some value they had on their books and got nothing of value in return. There’s an account type for tracking why your ne…

> While money can’t be created or destroyed (unless you run a central bank…)

That's not the case. Money, of course, is just a promise to provide something of some defined value at some point in the future. Anyone can make such promises. Heck, that's why we invented accounting – to keep track of the promises outstanding and delivered!

Re: Double-entry bookkeeping as a directed graph

#354

Earlier quoted context omitted.

That method only works if money can be created out of thin air, and also destroyed. The grandparent comment was pretty clear that money cannot be created out of thin air, nor can it be destroyed. A curious contradiction. How do we resolve it?

While money can’t be created or destroyed (unless you run a central bank…), value can be. Ledgers always have a specific perspective, and that perspective can assign a different value to something than someone else. In the case of gifting something, from the perspective of the gifter, they destroyed some value they had on their books and got nothing of value in return. There’s an account type for tracking why your ne…

> While money can’t be created or destroyed (unless you run a central bank…), value can be.

Money is created and destroyed by extending and resolving credit. central banks do it, but so do regular banks and non-bank institutions.

Re: Double-entry bookkeeping as a directed graph

#355

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

I'm a big fan of looking at usual problems through unusual lenses - while something normally easy is contrived, the different perspective might make a hard problem much more easily grokked.

I wish OP included a working project that lets one ingest a ledger, producing a graph. Perhaps this graph view might be used for "forensic" purposes, where a one-line entry buried deep would stand out as an odd node?

Still a hard sell with only one very basic example provided -- especially in a domain that's been around forever and where any advantage is critical. The DE ledger seems like a basic, simple tool, iterated into perfection over millennia. You'd think you could improve it, but good luck if you try.

Re: Double-entry bookkeeping as a directed graph

#357
post #346

Earlier quoted context omitted.

You read it correctly. The account's "balance" would be a "credit of $5". A transaction involves multiple accounts, so it would be written as multiple sentences: "Alice's account has a credit of $7. Bob's account has a debit of $7." If you want to write about the transaction itself, you could do that with a verb: "Transaction #23254 applies a debit of $7 to Bob's account, and a credit of $7 to Alice's account." A dou…

And here is a comment of mine where the reply states the opposite (I believe): https://news.ycombinator.com/item?id=39993175

I have no idea why they said that.

Re: Double-entry bookkeeping as a directed graph

#358
post #348
post #317

Earlier quoted context omitted.

I agree generally speaking, but what does that have to do with your local books? Nothing. You almost certainly don't have access to your employer's books. Also, the ledger entries for "bregma, services rendered" i.e. payroll will be much more complicated than that, there will be taxes, deductions, etc they have to account for as well.

> what does that have to do with your local books? It's how double-entry bookkeeping works. Money can neither be created nor destroyed. On your local books you have an account where money goes and appears to be destroyed, but in reality there is a doubled entry in someone else's books. Just because you're unaware of it does not mean it does not exist. And it's true that bookkeepers will have splits in their ledger in…

> It's how double-entry bookkeeping works.

Sorry, but no. I have no idea why you think double entry means 1 of the entries is in some other persons books that you don't have access to is somehow useful. Double entry is 100% local to a singular set of books.

The point of double entry accounting is to avoid many simple mistakes. If you can't access a 3rd parties books to check, what is the point of double entry accounting, when you only hold a single entry?

I literally have no idea how you think this even remotely makes sense.

> Money can neither be created nor destroyed.

Totally as an aside, money can indeed be created and destroyed, the govt and even banks do it all the time[0]. But I agree practically speaking from an accounting perspective in a singular person/organizations books money isn't created or destroyed it's just moved around. But for double entry accounting, it's 100% not useful to talk about money in some other person's books, it's irrelevant.

0: BOE, Money Creation in the Modern economy an introduction: https://www.bankofengland.co.uk/-/media/boe/files/quarterly-...

Re: Double-entry bookkeeping as a directed graph

#359

Earlier quoted context omitted.

> If you withdraw money from the ATM, you debit your bank account and credit your cash account You have that exactly backwards! Assets (like bank accounts and cash) are "debit accounts" meaning they increase with debits and decrease with credits. When you withdraw money from your bank account, the bank account goes down, so we know that must be a credit to the bank account, while the cash goes up, that is a debit to…

Do they have it backwards? It sounds like a valid perspective to me. I take money from an ATM: the number in my current account decreases, the cash I have on hand increases. Nothing wrong there. Sure the banks perspective is different but maybe I'm not interested in that. I love that this thread is full of people confidentally saying something that sounds correct or at least reasonable and the first reply that comes…

From the perspective of the person withdrawing their own money from a bank account, that account is an asset, same as the money in their pocket.

In accounting/bookkeeping parlance, "asset" and "debit" have a very strict meaning, but it's our job to make sure we are using them correctly and we agree that the usage is correct.

> Debits increase the value of asset

https://www.netsuite.com/portal/resource/articles/accounting...

> Asset accounts: Debit Increase, Credit Decrease

https://www.chase.com/business/knowledge-center/manage/debit...

Re: Double-entry bookkeeping as a directed graph

#360
post #11

I always enjoy these explainers that use computer science terms. In this case, you can be more precise about the type of graph: double-entry accounting creates a Directed[0] Bipartite Graph[1] with Labelled Edges[2]. Every edge is between a Transaction and an Account nodes, which makes it bipartite, and the amounts are edge labels. [0] https://en.m.wikipedia.org/wiki/Directed_graph [1] https://en.m.wikipedia.org/wiki…

No, it's not bipartite. in this article, every edge is between two Accounts. One edge is one transaction; one node is one account. Don't try to make transactions nodes, ew.
Post reply on HN