Friday, February 1, 2013

“Math Will Rock Your World” Digest

The article “Math Will Rock Your World”, a cover story featured in BusinessWeek and published on January 23, 2006, talks about the increasingly important role that mathematics and data analysis have played in industries and daily lives. In particular, subjects seemingly incongruous with analytic, such as linguistics, have become intertwined. This was discussed in the startup company Inform Technologies LLC, in which the algorithm “combs through thousands of press articles and blog posts” and “analyze each article by its language and context.” At the foundation of this data analysis are mathematical algorithms. Subjects and relationships between subjects combine to construct the polytope, “an object floating in space that has an edge for every known scrap of information.” This development is today’s informational revolution.

Technology companies, from Google to Facebook, are increasingly trying to make use of the gigabytes of information they have. The challenge is to use the information, most of which are stored as qualitative idea, into quantitative algorithms that can be propagated. These developments can be observed presently through efforts such as personally-targeted advertisement on Google searches or Facebook profiles. The article stresses the importance of data analysis in today’s business when it talks about how Ford Motor “could have sold an additional $625 million worth of trucks if it had lifted its online ad budget from 2.5% to 6% of the total.” Online advertisement allows companies to “profile customers” as the companies “know where their prospective customers are browsing, what they click on, and often, what they buy.” These ideas altogether illustrate the idea that access to information and the efficient mathematical analysis of the information can lead to great business solutions.

While this development fosters efficiency, it also raises some concerns that the article addresses. Utmost concern is privacy, which companies from Google and Facebook have all grappled with in the recent years. The inevitability of the “power of mathematicians to make sense of personal data and to model the behavior of individuals” will compromise privacy, and this is a concern not just for the individuals who data are being utilized. If the individuals fear for their data being manipulated beyond their range of comfort, they may lock the information up and prevent them from being utilized. This would hamper efforts of the mathematicians to develop algorithms and determine business or practical solutions. Another concern is the complexity of the new development. Managers must “understand enough about math to question the assumptions behind the numbers,” given that it becomes much easier to deceit “someone by having analysis based on lots of data and graphs.” As a result, this is the challenge for United States, as the article mentions. The country “must breed more top-notch mathematicians at home” by revamping education and simultaneously “cultivate greater math savvy” as the subject becomes more prevalent in the business profession.

For students studying mathematics and related fields, now is a great opportunity to foster these interests. Computer scientists and quantitative analysts are in high demand, and there is much room for development in this inchoate field. But even for those not directly working in this field, an understanding of the subject becomes increasingly important as well. A solid knowledge foundation allows for critical analysis of the technological improvements. As the field of data mining continues to revolutionaries business and the way society progresses, it is in the best interest of individuals to not only know how to best utilize these developments, but also to protect one’s own information to ensure that privacy is not greatly compromised in the reach for progress.

Source:

Tuesday, January 29, 2013

Inverse Transform Demonstration with Excel VBA

Given F(x) = 1-e^(-λ*x) as the cumulative distribution function, the inverse transform gives -1/λ*ln(U) as the function that has F(x) as its cdf, where U is the uniform distribution from [0, 1]. Here, the following VBA codes allow users to visualize this transformation in Microsoft Excel.

Upon the execution of this procedure, the user inputs a value for lambda. Then 10,000 simulations are run, initially generating a random number from [0, 1] and then inputting that random number into -1/λ*ln(U), and outputting the result in column A. At the end of the execution, column C contains the different x values from 0 to the maximum, in increments of 0.001. Column D reflects the cdf by counting entries of A that are smaller than the corresponding x value. Finally, column E calculates the true value of 1-e^(-λ*x). The idea is that the outputs in columns D and E are similar.

Sub InverseTransform()
'Demonstrates inverse transform of the cdf F(x) = 1-e^(-lambda*x)
Columns("A:E").Clear
Range("B1").Value = 1# * InputBox("Enter a positive value for lambda: ", "Input", 2)

'10,000 simulation trials to be performed
'Transform of F(x) gives -1/lambda*ln(U), where U is uniform distribution [0,1]
For i = 1 To 10000
Cells(i, 1) = -1 / Range("B1").Value * Log(Rnd)
Next i

'Determine the maximum for the range of numbers to work with
Range("B2").FormulaR1C1 = "=MAX(C[-1])"

'To determine the cumulative probability density, use 0.001 gradient from 0 to the maximum value as the counter
i = 1
While i / 1000 <= Range("B2").Value
Cells(i, 3).Value = i / 1000
'In column D, count entries in column A that are smaller than the counter, then divide by the number of trials
Cells(i, 4).FormulaR1C1 = "=COUNTIF(C[-3],""<""&RC[-1])/10000"
'In column E, calculate the true value of 1-e^(-lambda*x)
Cells(i, 5).FormulaR1C1 = "=(1-EXP(0-R1C2*RC[-2]))"
i = i + 1
Wend
Range("B2").Clear
End Sub

After the execution of this procedure, the user can perform further analysis. Graphing columns C through E does reveal that values in columns D and E are similar, as the points almost completely overlap. Error calculations from those two columns illustrate a similar result that the inverse transform method takes a function F(x), exponential function in this case, to produce a function whose cdf is F(x).

Wednesday, January 23, 2013

Monte Carlo Simulation of Pi with MATLAB

Using Monte Carlo simulation, the value of π can be approximated as (1/n) * Σ(4*sqrt(1-U_i^2)), where n is a large number representing the number of simulation trials, and U_i represents the i-th trial result from a uniform distribution in [0,1], for 1 ≤ i ≤ n. The MATLAB codes to run this simulation is quite straightforward:

numTrials = 1000000000;    %number of simulation trials
count = 0;
for trial = 1:numTrials
    roll = rand;    %uniform distribution [0,1]
    count = count + 4*sqrt(1-roll^2);
end
sum(count)/numTrials

In this simulation, n = 1,000,000,000. The output of 3.1416 matches the value of pi in all 4 displayed decimal places.

Monday, January 21, 2013

Intricacies of VLOOKUP

In Microsoft Excel, VLOOKUP is a very useful function that "searches for a value in the first column of a table array and returns a value in the same row from another column in the table array." The basic syntax of the function is =VLOOKUP(lookup_value, table_array, col_index_num, range_lookup), with the range_lookup being optional.

If range_lookup is FALSE, the function will look for only exact matches. In this case, the values in the first column of table_array do not need to be sorted. However, this is not the case if range_lookup is TRUE, which is the selection by default if omitted. Then the values in the first column must be in ascending order, as the function will use the largest value smaller than the lookup_value, if an exact match is not found.

Finally, two wildcard characters allow flexibility in the lookup_value when it is a text and the range_lookup is FALSE. A question mark (?) matches any single character, while asterisk (*) matches any sequence of characters. Use a tilde (~) before either the question mark or asterisk if they are the actual characters in the lookup_value. So as an example, the text value "abc" can be matched by both "a??" and "a*".

Source:

Tuesday, January 15, 2013

Seattle at a Glance

The largest city of the Pacific Northwest region, Seattle is home to over 600,000 people in the city proper and with 3.7 million residents, the Seattle-Tacoma-Bellevue Metropolitan Statical Area (Seattle MSA) is the 15th largest in the nation. The population grew by 8% between the 2000 and 2010 Census. A notable characteristic of the Seattle demographics is the level of education. For people over the age of 25, 56% of the residents have Bachelor's Degree or higher, which ranks Seattle among the top of major cities in the United States. University of Washington, the largest employer in the city proper, has over 40,000 students.

Seattle MSA accounts for 1.93 million jobs and generates an estimated gross metropolitan product of $218 billion. Aerospace, largely due to The Boeing Company, accounts over 80,000 jobs and $32 billion in revenue. Information technology is another important sector to the economy of Seattle MSA, employing over 100,000 and with companies such as Microsoft and Amazon.com headquartered in the region. Other notable companies headquartered in Seattle MSA include Costco, Starbucks, and Nordstrom.

International commerce is crucial to Seattle, which is situated roughly equidistant from Tokyo and London. Washington State ranks first in exports per capita, with Mainland China, Canada, and Japan as the top trading partners. Seattle-Tacoma International Airport is the closest airport on the continental US to Asia and served 31.2 million passengers in 2009. Internally, King County Metro and Sound Transit combine to offer express bus, light rail, and commuter rail services for the region.

In terms of the cost of living, Seattle trails major Northeastern and California cities from Boston to Los Angeles, and is comparable to that of Chicago. In 2010, 2 bedroom /1 bath apartment rental on average cost slightly over $1,100. Average high temperature in July is around 75F, while average low in winter hovers around the freezing point. At 36.2 inches, the average annual precipitation is actually lower than that of New York; summer is the dry season, while light precipitation and partly cloudy skies dominate the winter months.

Sources:

Monday, January 14, 2013

Currency Movements and Global Macro Calls

2013 Year Ahead Report published by Bank of America Merrill Lynch Global Research features 10 macro calls on the world economy. One call regarding interest rates and currencies states that "the U.S. dollar and euro could rally on the global recovery and greater fiscal clarity, pushing the yen lower and emerging market currencies higher." Another recall, regarding the crisis in Europe, states that "the big tail risk of a eurozone breakup has likely passed."

With this theme in mind, it was announced on Monday that Japan would further devalue its currency. It has already fallen 14% since October, and this has been helping the country's exports. Prime Minister Abe has "[stepped] up the pressure for the Bank of Japan to ease monetary policy" and increase the inflation target to 2%. The yen currently trades at 88.95 on the US dollar, which is near its 52-week high. While the yen has been pushed lower, the euro has hit an 11-month high against the US dollar, at $1.3382. Yields on Italian and Spanish 10-year bonds have stabilized to 4.19% and 5.03%, respectively. These numbers do go along the macro call from report that "European economy should stabilize as the year progresses."

Sources:

Friday, January 11, 2013

Principle World Cities by Time Zones

Here are the principle cities by time zones. This is not a comprehensive list of the time zones, as it excludes certain zones in the Pacific and Atlantic that do not have major cities. Most of North America and Europe utilize daylight saving time, as well as some of the major cities in South America and Australia. During the summer months, daylight saving time adds one hour forward.
  • UTC -1000: Honolulu
  • UTC -0900: Anchorage
  • UTC -0800: Los Angeles, Vancouver, Tijuana
  • UTC -0700: Denver, Calgary
  • UTC -0600: Chicago, Mexico City, Winnipeg
  • UTC -0500: New York, Toronto, Lima
  • UTC -0430: Caracas
  • UTC -0400: Santiago, San Juan, Halifax
  • UTC -0330: St. John's
  • UTC -0300: Sao Paulo, Buenos Aires
  • UTC ±0000: London, Lisbon, Casablanca, Accra
  • UTC +0100: Paris, Rome, Berlin, Madrid, Lagos, Zurich, Stockholm
  • UTC +0200: Cairo, Johannesburg, Athens, Istanbul, Helsinki, Jerusalem
  • UTC +0300: Nairobi, Baghdad, Riyadh
  • UTC +0330: Tehran
  • UTC +0400: Moscow, Dubai
  • UTC +0430: Kabul
  • UTC +0500: Karachi
  • UTC +0530: Delhi, Colombo
  • UTC +0545: Kathmandu
  • UTC +0600: Almaty, Dhaka
  • UTC +0630: Yangon
  • UTC +0700: Jakarta, Bangkok
  • UTC +0800: Beijing, Hong Kong, Perth, Singapore
  • UTC +0900: Tokyo, Seoul
  • UTC +0930: Adelaide
  • UTC +1000: Sydney
  • UTC +1100: Vladivostok
  • UTC +1200: Auckland, Suva

Saturday, December 22, 2012

Bicycle vs. Scooter: Usability vs. Storage

Bicycle and scooter are two simple non-motorized modes of private transportation. Each has its advantages and disadvantages, and in the end it comes down to a trade-off of usability and storage.

It's not surprising that bicycle is by far the more convenient mode to get from point A to point B. It is also better equipped to handle inclines, and has the better stopping mechanism with the brakes. The biggest drawback of bicycle is storage. Point B as a destination may or may not have convenient storage of the bicycle. Despite locks, bikes secured outside are not immune to damages from other people or the weather.

Scooter is the alternative to the storage issue, given that it is relatively easy to pack it in a small unit that can be carried by one hand into facilities like restaurants, which would not be able house a bicycle. However, on average the scooter may go only half as fast as the bike. It is also slowed down much more on upward inclines, and tires the leg (the standing leg in particular, not as much for the kicking leg) much more.

What are the implications of the trade-off of usability versus storage? Bicycles have comparative advantages in longer trips, while scooters have comparative advantages in shorter trips. There is no cutoff distance, as it will vary for each person's strength, the terrain of the path, and the surroundings of potential bike storage locations, but 1-2 miles serve as a reasonable estimate. For those more physically-fit, costs of using scooter is lowered. Smoother terrain will benefit the scooter, while inclines benefit bikes. Finally, of course better storage options benefit bicycles.

Thursday, December 13, 2012

Life Lessons from Longboarding

Believe it or not, there may be some lessons from longboarding that can be applied to real life. For background, longboard is just like a skateboard, except that it is bigger and goes faster. Comfortable cruising speed on a flat surface can hover from 8 to 10 mph. As the wheels are larger than those of the skateboard, the ride is much smoother. That said, the wheels are still small compared to those of devices like the bicycle, and as such, the longboard is still anything but immune to cracks on the ground.

Lesson one: focus on the present, with a sight for the future. While longboarding, it is imperative to focus on the current ground terrain and the terrain directly in front. Always be on the lookout for cracks on the ground, for they can and will trap the wheels and cause accidents if the cracks are too big for the wheels. No matter how smooth the ride it currently is, always focus on the present and the immediate future, and be ready to act on it.

Lesson two: uphold moderation. It is so much more fun to go faster on the longboard. However, with speed comes a lack of stability. Upon going down a hill, it may be tempting to accelerate down. But this is not like a bicycle where it comes with brakes. It becomes exponentially harder to stop when the speed is high, so it's always better to keep in moderation by maintaining a steady speed while going down hills. Do this by manually stepping off with one foot to decelerate before the speed is too high.

Friday, November 30, 2012

Spurs Fined for a Strategic Move

On Friday, NBA commissioner David Stern announced that the San Antonio Spurs will be fined $250,000 for sending 4 key players home, instead of playing them in a highly-anticipated nationally-televised game against the Miami Heat on Thursday. Stern claimed that the Spurs "did a disservice to the league and [the] fans" by taking its stars out in its only visit to Miami this regular season "without informing the Heat, the media, or the league office in a timely way." Spurs head coach Gregg Popovich's decision called for sending Tim Duncan, Tony Parker, Manu Ginobili, and Danny Green back to San Antonio to get some ahead of Saturday's home game against Memphis.

Heat star LeBron James summarized the collective disapproval of Stern's decision across the sports realm in very simple words: "it's not in the rules to tell you you can't send your guys home." Certainly some audience of the game may have been disappointed at not seeing the superstars from the two teams battle on Thursday night, but the fact of the matter is that Popovich and the Spurs had a broader goals in mind: best prepare for the entire season, not just this one game, and he had very justified reasons to rest his players. Thursday was the team's 6th road game in 9 days, and the 4th game of the week. On the flip side, Miami Heat was playing its first game since Saturday, and only its 5th game in 2 weeks. Given the severity of how lopsided the teams' schedules were coming into the game, the Spurs knew they were at a disadvantage, and it was strategically in their interest to rest their stars. Popovich said he had made this decision "when the schedule came out in July."

Stern didn't buy any of such, calling the action an "unacceptable decision." Yet, this is vastly different from the badminton scandal during the Olympics this summer, during which several badminton players from China, South Korea and Indonesia were accused of intentionally losing matches, so that "they could face easier opponents in future matches." There was little disagreement that such act of deliberately losing games was in the violation of the Olympic and sports spirit, and the players were expelled from their blatant actions.

What the Spurs did though, was drastically different from the actions of those badminton players. Many playoff-bound teams rest their star players in the final games of the regular season to give them rest. Sure, it's still early in the season in November, but the lopsided nature of the schedules of the two teams heading into Thursday's game was beyond the control of the Spurs, and they had to deal with this disadvantage. The Spurs made a strategic move, not a move that demeaned the spirit of the game. If anything, the short-handed Spurs over-delivered on expectations, as its usual bench players fought neck-to-neck with the defending-champions. It wasn't until 22.3 seconds left in the game that Heat delivered what proved to be the game-winning shot. The Spur took a gamble that nearly exceeded all expectations. Even if the game wasn't close, their decision was highly calculated, and NBA's decision to fine them dispirits its own sports of strategic maneuvers.

Sources: