Monday, January 2, 2017

We continue discussing the paper by Papadimitriou  - Algorithms, Games and Internet. We started with Nash equilibrium and then we discussed Internet Equilibria. We viewed the latter in terms of multi commodity flow network where the maximum total flow in a subgraph is in the core of a coalition game. The coalitions are not formed by a central governor.  It is decided locally. But if there were a central authority that allocates bandwidths to individual flows in order to maximize global optimum, then it may be better than the coalition game. This is referred to as the price of anarchy.
Next we look at markets.  Markets are known for price equilibrium.
In a market there are again n agents each of which posseses a non-negative vector of k goods and a concave utility function The agents may all be dissatisfied with their current endowments and there may be a reallocation of the same goods that is higher in everybody's utility. Once an optimum is reached and there is no further reallocation possible to improve, we have a pareto set of the market.
 The market inches towards the pareto set by way of bilateral and multilateral exchanges and bartering but this may come at considerable delay and communication cost. If instead of barter, we use price and currency, we can improve the efficiency and standardize the transactions. All we need is a price per unit of each good. In such a case, the only rational behavior for each agent would then be to sell her endowment ei at these prices and to buy a new vector of goods with the proceeds. However, the goods may not be enough to fill optimum affordable shopping cart for everyone and they may not be only so much that the shelves are left empty with no goods.
Arrow-Debreu 1953 theorem suggests that there is always a price vector p called the price equilibrium such that the market clears which means that the endowments are indeed the best vector of goods.
It was also noted that the price equilibrium may not exist if the goods are integer valued but in such cases, we can get 'approximate in expectation' if the number of goods is fixed.

#writeup on cloud computing : https://1drv.ms/w/s!Ashlm-Nw-wnWqXUqaKP1HX09wuwo

#codingexercise
Given a boolean 2D array, where each row is sorted. Find the row with the maximum number of 1s.
int GetRowWithMax1s(int[,] A, int r, int c)
{
int ret = -1;
int max = int_min;
for (int i = 0; i < r; i++)
{
int index = A[i].indexOf(1); // use binary chop since row is sorted
if (index != -1 && c-index > max)
{
    max = c - index;
    ret = i;
}
}
return ret;
}
static int indexOf(List<int> a, int start, int end)
{
if (a[start] == 1) return start;
if (start == end) {
    if (a[start] == 1)
         return start;
    else
         return -1;
}
int mid = (start + end) / 2;
if (a[mid] == 0)
    return indexOf(a, mid+1, end);
else
   return indexOf(a, start, mid);
}

No comments:

Post a Comment