Friday, December 30, 2016

We continue discussing the paper by Papadimitriou  - Algorithms, Games and Internet. We started with Nash equilibrium  which essentially says that we cannot predict if we consider the decisions by the participants in isolation and instead that decision making must be studied by taking into account the decision-makings of others.  The decision making is expressed in terms of a probability distribution over possible actions by each player. As long as the set of strategies form a convex set, there is a Nash equilibrium and finding Nash equilibrium translates to solving linear programming.
The next game we are going to look into is the Internet Equilibria.  Internet bandwidth is scarce and its allocation to individual end to end flows is achieved via the TCP/IP congestion control protocol. The congestion is handled this way : If the previous batch of packets got through, then increase the batch size by one. If not, decrease it by half. This has been working very well due to its simplicity but it is not clear of which game the Internet TCP/IP congestion control is a Nash equilibrium. There are a few ways in which this equilibria differs from the previous game. First, the equilibrium is not achieved by rational contemplation. It is achieved by interaction and adaptation in an environment where conditions and player populations change rapidly. Third, changes to strategies incur costs. Fourth, players cannot compensate each other by exclusive negotiations. There have been several theories advanced in this regard. The conditional game theory considers a game of n players as a set of possible 2^n-1 coalitions each of which can achieve a particular value which is the best possible sum of payoffs among players among the coalitions, against worst case behavior of players in the rest. However the game needs to be initialized with a certain value for the total payoff among the n players and this is difficult to do in the Internet Equilibria.  Another technique called the "core" was proposed to study these games. A vector in the real space is considered part of the core if the summation of payoffs over each coalition is greater than a particular value for all such coalitions. It draws the payoffs in such a way that no coalition has an incentive to secede because it cannot make more by itself than what is allocated in the coalition. This splitting of the total payoff is intuitive to the notion of equilibria but also very conservative due to which many games may have empty cores. Although the payoffs may not always be split in such a manner, this game is inherently coalitional is undisputed because the game can be seen as a flow network and flow happens due to coalitions.

#codingexercise
There is a square matrix of order n which is filled from 1 to n^2 in row major. Find the Kth element in spiral traversal of the matrix.
Example: Given n=3 and K=5.
Matrix:
1 2 3
4 5 6
7 8 9
Output: 9
By spiral order traversal  we are covering
k  <= m elements in the first row
k <= m+n-1 elements in the last column
k <= m+n-1+m-1 elements in the last row
k <= m+n-1+m-1+n-2 elements in the first column
else element lies in the inner matrix of dimensions m-2 rows and n-2 columns

int GetKth(int[,] A, int m, int n, int k)
{
if (n <1 || m < 1) return -1;
if (k <= m)
    return A[0, k-1];
if (k <= m+n-1)
   return A[k-m, m-1];
if (k <= m+n-1+m-1)
   return A[n-1, (m-1-(k-(m+n-1)))];
if (k <= m+n-1+m-1+n-2)
   return A[n-1-(k-(m+n-1+m-1)), 0];
return GetKth(A.SubArray(1,1,m-2,n-2), m-2, n-2, k-(2*n+2*m-4)));
}


No comments:

Post a Comment