The idea for this paper came to me after talking to my academic advisor. I told him that I wanted to take a particular class in economics that had a heavy math/theoretical bend to it. He reminded me that people do not act the way that economists assume they behave, which causes many parts of economic theory to collapse. So later I thought to myself, no, people do not always act how economists assume they behave, but a computer controlled agent could act how economists assume people behave, if programmed to do so, in which case all rules of economic theory would work.

This means three things. First, the behavior of artificial intelligence agents that behave under the assumptions made in economic theory can be predicted by economic theory. Second, one can test how well artificial intelligence agents do the things economists assume people do. Thirdly, artificial intelligence agents that behave under the assumptions made in economic theory can be used to do calculations of math relating to economic theory.

Of course, one must wonder why this is important. It is good to be able to predict what a group of AI agents will do. It is also good to be able to use this information in order to test how well the agents work. The final fact is particularly interesting however. We can do relatively hard math problems relatively quickly using artificial intelligence agents. By quickly, I mean the Big-O of the program is polynomial as opposed to exponential. There are many math problems out there that the best algorithms known take exponential time. This method allows us to get fairly exact answers in polynomial time.

The question arises if this is really doing math. The answer to this question is not that simple. At the very least, the end result will be a very good approximation. Economists make up a bunch of rules the same way mathematicians do, and they often provide some kind of backing of these rules the same way mathematicians prove their statements. So, if we were to create a model that followed all the assumptions of economics, then we would be “doing math.” Many assumptions leave room for gray area, however. Economists often make statements that assume “enough time” or “a large enough population.” Of course, it is difficult to say how much is “enough.” So, many people would consider these methods to result in “approximations,” but these approximations are not only going to be as accurate as anyone would need, but they will also be done relatively quickly.

There a few terms that need defining, so allow me to define them here. Of course, I will refrain from discussing details in too much detail for two reasons: there are many ways to implement the principles I will be discussing, and these are meant to be just general principles, not a tutorial in implementing these principles.

An entity behaves “under the assumptions made in economic theory” (“economically rationally”) if given a set of choices, it chooses the most beneficial one (it behaves “rationally”). (Many people do not behave “economically rationally” and thus economic theory fails to predict how human beings will behave in many cases.)

When I refer to an AI agent, I will imply an entity that is controlled by some means of artificial intelligence that behaves economically rationally. Within the context of a given market, it can be a buyer, seller, or both. It will therefore need the following properties: money, quantity of product, and reservation price for the product (the most it would pay for it). An agent could participate in multiple markets simultaneously, in which case it would need an extra quantity of product and benefit per unit of product for each extra market it participates in.

By market, I will mean a mechanism for the exchange of a particular good. All markets have a supply and demand curve. The demand curve is determined by the reservation prices of the buyers in the market, and the supply curve is the same as the marginal cost curve (marginal cost is the cost it takes to produce one more of the good, and is equivalent to the derivative of the total cost curve).

Let us take a simple example. One of the most basic things in economics is the idea of supply and demand graphs. Instead of labeling the axes x and y, we label them Q and P (for quantity and price). The supply and demand graphs can be portrayed as mathematical functions relating P and Q. This proves useful for many reasons, one of which is because the virtually always intersect.

The intersection of the supply (S) and demand (D) curves (by curves, I mean it in the mathematical sense—it can be a straight line) gives the price of an object and the quantity of the object bought/sold in the given market. If we create a large market of AI agents that buy and sell a certain good and behave under the assumptions economists use, the market price and quantity will go to the price and quantity of the intersection of the two curves, given enough time. Thus, we can do three things. First, we can predict before we run the program where the price will go to and what the quantity exchanged will be. Secondly, we can test how “well” the agents behave. Thirdly, we can use the fact that price and quantity will go to the point of intersection of the two graphs in order to compute the intersection of two curves that are identical to the supply and demand curves.

Setting up the supply and demand curves, of course, is tricky. It would be done by manipulating the reservation price of the buyers and the cost function for the sellers.

We can take advantage of the fact that the supply curve is the derivative of something to compute where the derivative of a function is a particular value. As was said above, given enough time, a market of independent entities will begin to work its way to the equilibrium point—the point where supply crosses demand. We will let the demand curve be a constant function (i.e. Demand curve is the function d(q)=c, where c is some constant and q is the quantity demanded), and use the fact that the supply function s(q)=the derivative of the total cost TC(q). We can find where on the x (or in this case, the q) axis TC(q)’s derivative is a particular value, which we will call n. We would therefore set d(q)=n. If we set up our market properly, the market price will become n and the quantity supplied/demanded will become the value we are looking for, namely, where the derivative of a function is n.

However, setting up the market is a difficult step. Let us start by setting up the demand curve. If the curve is of the form d(q)=c, then that means price (the value on the y-axis) is constant for all q (the value on the x axis)—the line is horizontal. The demand curve, as was said earlier, is determined by reservation prices. So, after thinking it through, one comes to the conclusion that all our buyers should have the same reservations price, and we should have that price be n. (Those who have taken economics may recognize that this market is therefore a perfectly competitive market).

The supply side of the market is a bit trickier. The sellers must be economically rational in order for this to work. In this case, we must have the sellers attempt to maximize profit. We must therefore get rid of the sellers who do not maximize profit. There are many methods we could use for working this. One way of doing it would to set the amount that each seller will sell at the beginning of each iteration, replace the lowest profiting sellers with copies of the highest profiting sellers (note: profit = revenue-cost, or profit=r(q)-c(q)=pq-c(q)), and allow for a small random mutation in how much each seller will sell. Yes, this is a genetic algorithm, and while mathematicians would say it will only approximately find the maximum, anyone who has used genetic algorithms knows that given enough time, the approximate maximum is as good as the actual maximum.

I could go on and on about different ways to implement this concept, but two examples should suffice. The idea that we can use economics and artificial intelligence together to solve really hard math problems is not only very useful but very beautiful.

Remember you can visit the *Message Store* to discuss this essay.
Comments are always welcome!.
There are already replies in the thread, why not join in?