Friday, November 29, 2013

VBA Simulation of Shuffling and Distributing a Deck of Cards

Here's a simple VBA program that simulates shuffling and distributing a standard deck of 52 cards to 4 players. The program outputs the results in cells A1 through D13 of the current Excel spreadsheet, with the 4 rows corresponding to the 4 players' cards.
Sub ShuffleCards()
'This program simulates shuffling of a standard deck of 52 cards to 4 players
'Results are outputted in 4 columns in cells A1:D13

'H: heart, S: spades, D: diamod, C: club
'2 thru 10, J for jack, Q for queen, K for king, A for ace
'2H would be 2 of hearts, KD would be king of diamonds, etc.

'Creating
suits = Array("H", "S", "D", "C")
num = Array("2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "A")

Dim cards(0 To 51) As String
For i = 0 To 3
For j = 0 To 12
cards(13 * i + j) = num(j) & suits(i)
Next j
Next i

'Shuffling
For i = 1 To 1000
c1 = Int(52 * Rnd)
c2 = Int(52 * Rnd)
temp = cards(c1)
cards(c1) = cards(c2)
cards(c2) = temp
Next i
'Distributing
For k = 0 To 51
Cells(k Mod 13 + 1, Int(k / 13) + 1) = cards(k)
Next k
End Sub

The shuffling algorithm is to run through 1000 iterations of swapping two randomly chosen cards.

Sunday, November 24, 2013

“Comments on the Interpretations of Game Theory” Digest

In the paper “Comments on the Interpretations of Game Theory,” published in Volume 59, Issue 4 of Econometrica in July 1991, Ariel Rubinstein discusses notions of game theory and strategy that aims to highlight some of the inconsistency between the interpretation and application. Rubinstein argues that equilibrium strategy describes not only a player’s plan of action, but also the considerations that support the optimality of the plans. The paper also argues that models should encompass the perception of a real life situation by the decision makers. Game theory, as Rubinstein writes, is not simply about abstract mathematics but about the real world.

The first half of the paper deals with the notion of strategy. Rubinstein argues that the conventional interpretation is inconsistent with the way it is applied, leading to confusion. In one of the contexts, Rubinstein talks about extensive games with more than one moves. In the game, a player’s strategy is required to specify an action for each node in the game tree corresponding to that player’s movement. However, the incongruence comes when an action must be specified, even after earlier moves that would make the subsequent decision point inconsistent with the earlier moves. The necessity of this specification stems from the need to determine subgame-perfect equilibrium to test the rationality of the plans. In all, a strategy needs to encompass not only the player’s plan, but also the opponents’ belief in the chance that the plan was not followed.

Rubinstein also looks at the interpretation of strategy in mixed strategies. While intuitively problematic, there are clear cases in which players choose random actions, preferring over pure strategies. One interpretation of mixed strategy is to use a large population and having each occurrence take a random draw of the items from the population. Another interpretation is the purification idea, whereby a mixed strategy is dependent on private information not specified in the model. This interpretation argues that ostensibly random behaviors are actually deterministic. Finally, Rubinstein looks at the case of limited memory, which helps to keep modes of behavior simple. When probabilistic nature of doubt is introduced, there may be additional decision points that are unreachable, but added to the game form merely to allow the discussion of reasoning in the state of doubt.

From these discussions, Rubinstein tries to adopt the view that a game is not “a rigid description of the physical rules of the world,” but instead a “comprehensive description of the relevant factors involved in a specific situation as perceived by the players.” Towards that idea, model should include only the factors perceived by the players to be relevant, making the application of game theory “more of an art than a mechanical algorithm.” Finally, Rubinstein talks about regularity, which is necessary for employing game theory as a descriptive science. Game theory, in conclusion, builds models from intuition and from mathematical knowledge uses deductive arguments, which can’t discover the truth alone. Instead, game theory also deals with psychological elements, which help to distinguish humans from machines, which Rubinstein believes is “more exciting and certainly more meaningful.”

Monday, November 18, 2013

San Diego - Tijuana Border and Flight Comparison

A proposed solution to San Diego's crowded airport is to build a pedestrian bridge to Mexico. Tijuana's General Abelardo L. Rodriguez International Airport (TIJ) is located just across the US-Mexico border, and the proposed bridge, about 20 miles away from downtown San Diego, would allow people to cross the border into the airport. Otay-Tijuana Venture, the project's developer, cites that of the "roughly 4 million people who fly into and out of TIJ each year, more than half cross the border one way or the other." However, crossing the San Diego - Tijuana borders on automobile involves notoriously long waiting times. Some prefer to cross by foot and then catch transportation on the other side. San Ysidro crossing between the two cities is the world's busiest port of entry.

How much cheaper is it to fly out of Tijuana instead of the San Diego area airports? The following are the costs of the cheapest flights, for one adult roundtrip, from Expedia retrieved tonight, departing on Monday, December 7th and returning Wednesday, December 9th:

Destination San Diego Tijuana
New York $351.10 $972.59
London $2,214.60 $2,282.60
Tokyo $1,050.50 $3,932.80
Sydney $1,577.80 $3,082.21
Cairo $1,316.68 $3,930.00
Rio de Janeiro $1,269.49 $1,540.55
Panama City $800.40 $938.19
Mexico City $342.59 $291.16
Cancun $400.40 $371.04

For many of these cities, San Diego offers an enormous discount. Even for other Latin American destinations, San Diego offers cost advantage. It is only within Mexico that Tijuana offers cost advantages. The Tijuana flights to rest of Mexico are also more frequent and have fewer stops on average. Looking at just these results then, it would seem as though the pedestrian bridge serves to relieve those in Southern California traveling to various parts of Mexico by air. A positive externality would be slight relieving of the border crossing for those going to the airport.

Sources:

Sunday, September 29, 2013

Informational Competitive Advantage from Freedom of Information Act

Last Monday's Wall Street Journal featured an article that illustrated a trend in investment firms obtaining information through the Freedom of Information Act to make strategic decisions. In particular, the article highlighted SAC Capital Advisors contacting the Food and Drug Administration for information regarding a drug from Vertex Pharmaceuticals. SAC was able to use this information and purchase 13,500 shares of Vertex, whose stock rose by over 60% in a single day when further benign results were announced.

According to the United States Department of Justice, Freedom of Information Act "is a law that gives you the right to access information from the federal government." Signed into law in 1966, the Act "provides individuals with a statutory right of access to certain federal agency records." There are exemptions, and one of which is concerned with "business trade secrets or other confidential commercial or financial information."

While investors typically don't solely rely on the information from the Act, the valuable piece of information "helps them to piece together investment strategies or evaluate a company's prospects." Over 650,000 requests were received in fiscal year 2012, out of which over 93% were released in full or part. Within the different agencies, Department of Homeland Securities overwhelmingly received the most requests.

Sources:

Sunday, September 22, 2013

Effects of Depreciation on Financial Statements

The effects of financial transactions on the three major forms of financial statements: balance sheet, income statement, cash flow statement, are important to understand the financial performance of any corporations. While most effects are intuitively understood, a few deserve special attention.

Depreciation: if depreciation amount and tax rate were 100 and 20%, respectively, then the net income would fall by 80. However, on the cash flow statement, there will be an increase of 20 in cash flow from operations. This is because the cash flow statement starts from the net income and adds back the full amount of depreciation. The depreciation itself caused no change in cash amount. The tax deduction from the depreciation allowed for more cash to be retained. Combining this all on the balance sheet, there would be 20 increase in cash and 100 decrease in net PPE. This 80 decrease is matched by the 80 decrease in equity, given the depreciation expense of 80.

Loss / gain on sale: if there was 100 loss on sale and given 20% tax rate, earning before tax would decrease by 100, and similarly net income would fall by 80. Assets would fall initially by 100 but with only 80 decrease in equity, the 20 is matched by increase in cash from not having to pay the additional tax, in similar fashion to depreciation. On the reverse, 100 gain on sale would only increase assets and equity by 80, given the additional tax expense.

Microsoft Nokia Deal Summary

Microsoft Corporation and Nokia Corporations announced a deal on September 3, in which Microsoft would pay $7.17 billion USD to purchase Nokia’s Devices & Services business and license Nokia’s patents. Microsoft will utilize its overseas cash reserves to complete the transaction. At the end of Q2-2013, Microsoft’s cash and short-term investments totaled more than $76 billion. Nokia’s mobile business, which Microsoft purchased for 3.79 billion Euros, generated nearly half of Nokia’s 30.2 billion Euro revenue. In all, the purchase was a bargain for Microsoft.

The challenge comes to integrating the businesses. More than 30,000 Nokia employees were brought into Microsoft, including former CEO Stephen Elop. The two companies have been in partnership since 2011, and this deal is the second largest acquisition Microsoft has ever done. The acquisition also marks a remarkable transition in the Windows business model: vertical integration, as Microsoft aims to introduce its Windows Phone software into the hardware units. Microsoft has long touted a separation of software and hardware in the PC era. But as mobile hardware has been less commodity-like than computer hardware, Microsoft expects this deal to be accretive to its adjusted EPS starting in fiscal year 2015. Microsoft had been receiving less than $10 in software licensing fees from Nokia, but now can make more than $40. The challenge becomes selling more Windows phones. Currently it lags behind Android and iOS. And with Apple introducing reduced-cost iPhone models, the challenge becomes even harder for Windows Phone to find its niche.

Two weeks after the Nokia deal, Microsoft announced that it would increase its dividend 22% over the previous quarter, and authorized up to $40 billion in share repurchases.

Sources:

Sunday, August 25, 2013

Marketing Myopia

Marketing myopia is an important paper first published in 1960 by Theodore Levitt, which argues that declining industries are results of failure of management to align their business with customers' needs. Levitt cites the railroads, which "assumed themselves to be in the railroad business rather than in the transportation business." By being "product oriented" instead of "customer oriented," the railroads allowed other modes to fulfill customers' transportation needs. Similarly, Levitt argues that Hollywood incorrectly defined its business as the movies, rather than the entertainment. By embracing a "specific, limited product," Hollywood "rejected TV when it should have welcomed it as an opportunity ... to expand the entertainment business."

This analysis resonates with the concept of business cycle. During the growth phase of an industry, its "assumed strength lay in the apparently unchallenged superiority of its product." However, Levitt believes that "there is no such thing as a growth industry," as there "are only companies organized and operated to create and capitalize on growth opportunities," while those who "assume themselves to be riding some automatic growth escalator invariably descend into stagnation."

Source:

Thursday, August 22, 2013

Reverse Percentage Change

It takes little computation to realize that the magnitude of percentage change from a to b isn't the same as that from b to a. The jump from 40 to 60 is 50% increase, but from 60 to 40 is 33.3% decrease. What's the exact formula for converting the magnitude of percentage changes? Let a and b be any nonzero integers.

For convention, let's have these labels:
  • a: starting number, 40 in this case
  • b: ending number, 60 in this case
  • x: change from a to b, calculated as (b - a) / a, 50% in this case
  • y: change from b to a, calculated as (a - b) / b, -33.3% in this case
The goal is to derive y from x. Follow these steps:
  • x = (b - a) / a
  • -x = (a - b) / a
  • -x * a = (a - b)
  • - x * a / b = (a - b) / b
So given x as the percentage change from a to b, the percentage change from b to a is simply the - x * a / b. In this example, -(50%) * 40 / 60 = -33.3% indeed. This works when a is bigger than b as well: a = 20, b = 10, x = (10 - 20) / 20 = -50%, y = -50% * 20 / 10 = 100%.

Sunday, June 23, 2013

Generic Competitive Strategies

The second chapter of Competitive Strategy looks at three approaches in "coping with the five competitive forces" outlined in the previous chapter, which are industry competitors, potential entrants, substitutes, suppliers, and buyers. The three strategies include overall cost leadership, differentiation, and focus. While they are not mutually exclusive, it is "rarely possible" to pursue multiple approaches.

Overall cost leadership entails "aggressive construction of efficient-scale facilities" to minimize cost, which provides "high margins which can be reinvested." This strategy is usually associated with high volume and market share. Differentiation sacrifices volume for perception of uniqueness industry-wide. Finally, focus strategy is "built around serving a particular target very well." Honed onto a particular segment only, focus can pursue either low cost, high differentiation position, or both.

The chapter notes that a "firm failing to develop its strategy in at least one of these three directions ... is in an extremely poor strategic situation" and "is almost guaranteed low profitability." These firms lose both the high-volume customers looking for low costs, and the high-margin business that depends on differentiation. While each of these strategies has its set of risks, these three generic competitive strategies give an intuitive explanation of the U-shaped relationship between profitability and market share, as observed in some industries.

Thursday, June 20, 2013

Backward and Forward Integration

The first chapter of Competitive Strategy talks about structural analysis of industries, which aims to relate "a company to its environment." Among the five competitive forces surrounding a company are industry competitors, potential entrants, substitutes, suppliers, and buyers. A buyers or supplier can exert competitive force with credible threat of backward or forward integration, respectively.

Buyer can engage in backward integration by purchasing the parts it typically procures from suppliers. This poses competitive force on the suppliers. On the other hand, suppliers can engage in forward integration by expanding activity "to include control of the direct distribution of its products," posing competitive force on the buyers typically involved in the distribution. The same company can be both a buyer or supplier in different markets. A manufacturing company, for example, may be the buyer in the market for raw materials, but becomes the supplier in the market of the assembled goods to other companies.

Sources: