When Linear Algebra Meets Accounting
Written by Frank Jin and Xingyuan Gu
When I studied in the accounting honors program in the Ohio State University, I was extremely attracted when our professor, Douglas A. Schroeder, introduced the idea of applying linear algebra in accounting. In this article, I will use a simplified version of financial statement to illustrate this application.
First of all, I would like to explain the concepts of the key components of this application:
- Incidence Matrix (A)
An incidence matrix associated with the financial statement is a compact representation of journal entries. More specifically, each row of the incidence matrix represents an account, and each column of the incidence matrix represents a transaction. Additionally, debits of journal entries are denoted as 1 and credits of journal entries are denoted as -1. For example, suppose we have the following financial statements:
Our incidence matrix will therefore has 8 rows associated with 8 accounts (financial statement accounts as well as temporary accounts) from balance sheets and income statement (Cash, Account Receivables, Inventory, PP&E, Account Payables, Revenue (or Sales), Cost of Sales, and Other expenses). Furthermore, assuming we know the following transactions but are not sure about the magnitudes of these transactions:
We can recognize the journal entries (which account to debit and which account to credit) associated with these transactions, and then denote these relations as either 1 or -1:
Or more professionally:
2. Change in Account Balances (x)
The change in account balances is simply the difference between the beginning balance and the ending balance of an account. Since we have 8 accounts in our example, we will have 8 differences, and we can therefore put these 8 numbers into a vector. One important thing to notice is that the signs of changes in Liability accounts as well as in Owner’s Equity accounts should be reversed, because Asset = Liability + Owner’s Equity so that Asset - Liability - Owner’s Equity = 0, which means a positive increase in Liability or Owner’s Equity will result in a decrease in the above equation (therefore the signs are reversed). Here are the changes in different accounts:
3. Transaction Amounts (y)
Since we are investigating the transaction amounts, we will use a vector of variables, y1 ~ y10 (since we have 10 transactions in our example), to represent the transaction amounts.
As a result, the relation among the journal entry structure, transaction amounts, and changes in account balances can therefore be represented by Ay=x, where, as mentioned above, A is the incidence matrix, y and x are both vectors. In linear algebra, we can solve this equation by forming an augmented matrix and implement Row Reduced Echelon Form (RREF) to find the values of y. However, just like in our example, normally there will be more transactions than accounts. In other words, the number of columns is greater than the number of rows. So it is unlikely to find a consistent solution for y (explanation).
To approach this problem, our next step is to find the basis of the nullspace of our incidence matrix A. We used MATLAB to simplify our calculations:
Thus, by definition, the basis of the nullspace is:
From the results, we can recognize that the nullspace can be composed by the combinations of y6, y8, y10 and their associated basis. By assuming y6, y8, and y10 to be 0, we can therefore define the transpose(yp) = [y1 y2 y3 y4 y5 0 y7 0 y9 0], which is one possible solution for y. One way to do this is to cross y6, y8, and y10 columns in the original incidence matrix and augment the changes in account as the last column in matrix A, let’s call this matrix as Ralph. Then, we can simply RREF the matrix Ralph to find the values for all y except y6, y8, and y10.
Finally, we can write a general solution as follows. Now, we only need to check 3 transactions to know the values of all transactions, which is much more efficient than the traditional accounting method that requires numerous T-accounts to audit transactions.
In conclusion, this relationship between linear algebra and accounting is inspirational. It incomparably improves the efficiency as well as the accuracy in auditing transactions, which potentially could change the traditional public auditing industry. We believe this interesting relationship could also be used in other fields, and yet we are open to discussions.