Sunday, April 10, 2011

Why does 0! = 1?

You are correct that 0! = 1 for reasons that are similar to why

x^0 = 1. Both are defined that way. But there are reasons for these definitions; they are not arbitrary.

You cannot reason that x^0 = 1 by thinking of the meaning of powers as "repeated multiplications" because you cannot multiply x zero times.

Similarly, you cannot reason out 0! just in terms of the meaning of factorial because you cannot multiply all the numbers from zero down to 1 to get 1.

Mathematicians *define* x^0 = 1 in order to make the laws of exponents work even when the exponents can no longer be thought of as repeated multiplication. For example, (x^3)(x^5) = x^8 because you can add exponents. In the same way (x^0)(x^2) should be equal to x^2 by adding exponents. But that means that x^0 must be 1 because when you multiply x^2 by it, the result is still x^2. Only x^0 = 1 makes sense here.

In the same way, when thinking about combinations we can derive a formula for "the number of ways of choosing k things from a collection of n things." The formula to count out such problems is n!/k!(n-k)!.

For example, the number of handshakes that occur when everybody in a group of 5 people shakes hands can be computed using n = 5 (five people) and k = 2 (2 people per handshake) in this formula. (So the answer is 5!/(2! 3!) = 10).

Now suppose that there are 2 people and "everybody shakes hands with everybody else." Obviously there is only one handshake. But what happens if we put n = 2 (2 people) and k = 2 (2 people per handshake) in the formula? We get 2! / (2! 0!). This is 2/(2 x), where x is the value of 0!. The fraction reduces to 1/x, which must equal 1 since there is only 1 handshake. The only value of 0! that makes sense here is 0! = 1.

And so we define 0! = 1.

Source: http://mathforum.org/library/drmath/view/57128.html

Saturday, April 9, 2011

Data is (are?) Beautiful

It’s usually girls who blogs about jewelry, and me who blogs about charts and data, but today the tables are turned – well, almost. Wieden+Kennedy London have come up with a range of designer necklaces which celebrate the beauty of data, under the name Plot.

The necklaces use charts of thirty years of various commodity prices (gold, silver, oil and lead) to form the motifs that are embedded within the resin pendants. They’re the brainchild of Lisa Prince, a strategist at Wieden+Kennedy who apparently got the idea while sitting in a meeting staring at PowerPoint charts.

So if you happen to have a data-geek woman in your life, and you’ve dismissed my previous nerdy gift idea as too fattening, one of these necklaces could be just what you’re looking for.

Source:http://www.liesdamnedlies.com/2009/11/data-is-are-beautiful.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+LiesDamnedLies+%28Lies%2C+Damned+Lies...%29&utm_content=Google+Reader


Wednesday, April 6, 2011

The Difference Between Web Reporting And Web Analysis

Someone asked me this very simple question today. What's the difference between web reporting and web analysis?

My instinct was to use the way observation uttered by US Supreme Court Justice Potter Stewart in trying to define
porn: "I know it when I see it."

That applies to what is analysis. I know it when I see it. : )

That, of course, would have been an unhelpful answer.

So here I what I actually said:

If you see a data puke then you know you are looking at the result of web reporting, even if it is called a dashboard.

If you see words in English outlining actions that need to be taken, and below the fold you see relevant supporting data, then you are looking at the result of web data analysis.

Would you agree? Got an alternative, please submit via comments.

I always find pictures help me learn, so here are some helpful pictures for you. . .

This is web reporting:google analytics report

And so is this, even if it looks cuter:

sitecatalystreport

And while you might be tempted to believe that this is not web reporting, with all the data and the colors and even some segments, it is web reporting:

excel report

See the common themes in all the examples above?

The thankless job of web reporting, illustrated vividly above, is to punt the part of interpreting the data, understanding the context and identifying actions to the recipient of the data puke.

If that is your role, then the best you can do is make sure you have take the right screenshots out of Site Catalyst or Google Analytics, or charge an extra $15 an hour and dump the data into Excel and add a color to the table header.

So what about web analysis?

The job of web analysis mandates a good understanding of the business priorities, creation of the right custom reports, application of hyper-relevant advanced segments to that data and, finally and most importantly, presentation of your insights and recommended action using the locally spoken language.

See the difference? It's a different job, requires different work, and of course radically different skills.

Examples of web analysis? I thought you would never ask. . .

This is a good example of web analysis:

executive management dashboard

[And not only because it is my work! Learn more about it here: Action Dashboard.]

Notice the overwhelming existence of words. That's not always sufficient, but I humbly believe always necessary.

When you look to check if you are looking at analysis or reporting look for Insights, Actions, Impact on Company. All good signs of analysis.

Here's another example of really good web analysis:

bwt site traffic analysis sm

[Click on the image above for a higher resolution version.]

Ignore how well or badly the business is doing. Focus on approach taken.

Here are some things that should jump out. . . . A deliberate focus on only the "movers and shakers" (not just the top ten!). Short table: just the key data. Most of the page is taken up with words that give insights and specific actions to take.

Another example that I particularly like, both for the style of presentation and how rare it is in our world of web analytics. . .

web data analysis example sm

[Click on the image above for a higher resolution version.]

No table, no rows, no pies. And yet data holds center stage with clearly highlighted actions.

Normally, we all do the column on the left (it might look different, but we have it). Unfortunately we don't appreciate is the power of the middle column ("segmentation reveled"). That is super important because it gives the recipients exposure to the hard work that you have done and in a very quiet ways increases their confidence in your work. Guess the outcome of that? They take the actions you are recommending!!

Analysts constantly complain that no one follows any of their data-based recommendations. How do you expose your hard work? In a garish Las Vegas show girl fashion where all the "data plumes" are, unsexily in this case, hanging off the body? Or, in quite concise ways? Only one of those two work.

One more? Okay here you go. . .

search data analysis example sm

[Click on the image above for a higher resolution version.]

Diana has loads of observations, supported by visuals (sometimes it really helps to show the search results or the emails or the Facebook ad) with highlights (actually lowlights) in red, and finally recommendations.

And note the tie to outcomes (another common theme in all examples above). In this case, the search improvements are tied to the increase in donations I can make because of sales of my book. 1.5 extra smiles per month! (All my proceeds from both my books go to charity.) A good way to get attention from the "executive" and get him or her to take action.

Do that. A lot. Be creative. Yes it is hard work. But then again glory is not cheap, is it?

Exceptions to the rule.

Not every output you get from your Analyst, or "Analyst" :), with loads of words on it, instead of numbers, will be analysis. Hence my assertion that "I know it when I see it." Words instead of data pukes is just a clue, read the words to discern if it actually is analysis or a repeation of what the table or graph already says!

In the same vein not every output that is chock full of numbers in five size font, with pies and tables stuffed in for good measure, is a representation of web reporting. It is hard to find the exceptions to this rule, but I have seen at least two in nine years.

Top 10 signs that you are looking at / doing web analysis.

Let's make sure this horse is really and truly dead by summarizing the lessons above and using a set of signs that might indicate that you are looking at web analysis. . .

    #1. The thing that you see instantly is not data, but rather actions for the business to take.

    #2. When I see Economic Value I feel a bit more confident that I am looking at the result of analysis. Primarily because it is so darn hard to do. You have to understand business goals / outcomes (so harrrrrd!) and then work with Finance to identify economic value, and then you have to configure it in the tool and then apply advanced segments, and then figure out how things are doing. That is love. I mean that is analysis! Or at least all the work that goes into being able to do effective analysis.

    #3. In the same vein, if you see references to the Web Analytics Measurement Model (or better still, see it in its entirety on one slide up front), then you know that the Ninja did some analysis.

    #4. Any application of algorithmic intelligence, weighted sort, expected range for metric values (control limits), or anything that even remotely smells of ever so slightly advanced statistics is a good sign. Unknown unknowns are what it's all about!

    Also mere existence of statistics is not sufficient. All other rules above and below still apply. :)

    #5. If you see a Target mentioned in the report / presentation, then the Analyst did some business analysis at least. See the top right of the picture immediately above.

    #6. Loads and loads and loads of context! Context is queen! Enough said.

    #7. I have never seen web analysis without effective data/user segmentation. I think this statement is in both my books. . . "All data in aggregate is crap." Sorry.

    #8. If there is even a hint of the impact of actions being recommended then I know that is analysis. It is hard to say: I am recommending that we shift this cluster of brand keywords to broad match. It is harder to say: I am recommending. . . and that should increase revenue by $180,000 and profit by $47,000. Look for that.

    #9. If you see more than three metrics in a table you are presented with then you might not be looking at analysis.

    #10. Multiplicity! If you see fabulous metrics like Share of Search (competitive intelligence) or Task Completion Rate (qualitative analysis) or Message Amplification (social media) then they are good signs that the Analyst is stepping outside Omniture / WebTrends. I would still recommend looking below the surface to ensure that they are not just data pukes, but the good thing is these are smarter metrics.

    User Contributions:

    #11. From Carson Smith: If someone looks at your analysis / report / presentation / dashboard and has to ask "and… as a result?", then it might be reporting. What happened should be obvious.

    [I love applying the "Three Layers of the So What" test to any analysis I present or see. I ask "so what" three times. If at the end of it there is no clear action to be taken then I know it is just web reporting, not matter how great it looks or how much work went into it. Ask "as a result?" or "so what?" to your work!]

    #12. From Chuck U: 1) If it can be automated, it's probably not analysis 2) If your data warehouse team says they can automate it for you, then it's definitely not analysis. [#awesome! -Avinash]

Can you think of other signs? Please share your suggestions via comments. I'll add the best ones to this list.

In the list above, and in the examples in this post, you see my clear, and perhaps egregious bias for business analysis and business outcomes and business actions and working with many parts of the business and business context. But I've always believed that if you and I can't have an impact then why are we doing what we do?

I hope you've had some fun learning how to distinguish between web reporting and web analysis. It is a fact of life that we need both. The bigger the company, the more they want data pukes, sorry, reporting.

But if you have "Analyst" in your job title then you perhaps now have a stronger idea of what is expected of you to earn that title. If you have hired a "web analysis consultant" and are paying them big Rupees then you know what to expect from them. Don't settle for data pukes, push them harder. Apply the rules above. Send their "analysis" back. Ask for more. Raise your expectations!!

I hope now "you'll know it when you see it," and have more datagasms!

Okay, it's your turn now.

How would you answer the question about the difference between web reporting and web analysis? What signs do you look for when evaluating the work of your Analyst or Consultants?

Please share your thoughts via comments below.

Thanks.

PS: In case you are curious here's the current official definition of po rn, as outlined in Miller v. California:

(a) whether the 'average person, applying contemporary community standards' would find that the work, taken as a whole, appeals to the prurient interest,

(b) whether the work depicts or describes, in a patently offensive way, sexual conduct specifically defined by the applicable state law, and

(c) whether the work, taken as a whole, lacks serious literary, artistic, political, or scientific value.

The Difference Between Web Reporting And Web Analysis is a post from: Occam's Razor by Avinash Kaushik

http://www.kaushik.net/avinash/2011/04/difference-web-reporting-web-analysis.html?utm_source=rss&utm_medium=feed&utm_campaign=Feed%3A+OccamsRazorByAvinash+%28Occam%27s+Razor+by+Avinash+Kaushik%29&utm_content=Google+Reader

Lesson of Application of Statistics from The World Cup

"No century-scorer has ever been on the losing side of a World Cup final."

That was what they said on Twitter, TV and on the internet when Mahela Jayawardene scored his hundred, as Sri Lanka went on to make 274. It was a crippling statistic — the number of times it was repeated almost made me switch off the TV; what was the point of watching the rest of the match if we had lost to the numbers?

If you went just by statistics, there were more reasons for India to lose, just after the Sri Lankan total was posted:

  • Highest score ever chased successfully in a World Cup final: 241 (by Sri Lanka, 1996)
  • History of a team successfully chasing in a World Cup final: 2 out of 9 (23%)

But since India won, we had "beaten the odds". Did we really? Consider that there have just been nine World Cups in the past. That's already too little data. Just nine World Cup finals is not enough to say the tenth has "odds stacked against it". There were no odds to begin with.

Further, out of the nine past World Cup finals, only five have seen centuries. In 1983, when we beat West Indies, no one managed to even reach 50. That means there were only five real data points. Commentators might be forgiven for throwing a sound bite ever so often, because when you hold a mike, you have to say something, but listeners need to separate the wheat from the chaff.

Next, the idea that the past would determine the future, even when the past is based on such shaky foundations, is strange. Especially when it made no sense whatsoever; there is no reason that a team with a century-scorer should always win, and while I haven't done the analysis, I would be very surprised if in ALL one-day matches, century scorers were always or even more than 80% of the time on the winning side.

Why do I harp about this? Because it happens all the time with investing and trading. There was a scare in August 2010 about a "Hindenburg Omen", an obscure indicator that has supposedly preceded every major US Stock market crash since 1987. But it hasn't quite indicated a crash every time it occurs — just 25% of Hindenburg Omen occurrences were observed to have preceded a major market crash. And then, the indication required things like "The daily number of NYSE new 52-week highs and the daily number of new 52-week lows must both be greater than 2.2% of the total NYSE issues traded that day.

The 2.2% always gets me suspicious — is there a reason for the 2.2%, or is it a number manufactured to make the indicator work? Put another way, are we assuming the conclusion and retro-fitting the data on to it? If 2% didn't work, let's try 2.1%. No? 2.2%. There. Or this could go on, like, "The number of 52-week highs should be less than the number of sunspots recorded, unless there was a suicide in Manhattan." Eventually, you will have an indicator, and a brain full of jelly, but not much else.

Many so-called indicators for stocks and indexes take on complex hues, such as taking on moving averages of moving averages and so on. The moving average is simply a "smoothing" function — it gets rid of periodic volatility to tell you the recent trend. But smoothing has its disadvantages; it reacts slowly to sudden changes, so it will only tell you the trend has changed after the trend has changed, sometimes too late to actually take action. A moving-average-based indicator will always be a little late, and you should naturally be suspicious of any 'formula' that can predict the next move, based purely on moving averages of price. At best, they can tell you a trend, and if the hypothesis is that the trend will sustain, and that bears out historically in enough instances, you might have a hope with it.

But you can always find a moving average that has predicted the market, using the right numbers and eliminating some inconvenient data by ignoring it — does that mean you've found the Holy Grail? I wish the answer was yes, because I have a whole heap of such formulas invented over the years that are as profitable as used toothbrushes.

"The real estate market has never gone down in any meaningful way" — this statement was often quoted by real estate agents and brokers in the US, and it might have even been statistically valid, with over 50 years of data supporting it. But wasn't that just correlation? Housing bubbles have been known to go bust in the past, and in different countries. From Sweden to the UK to Greece to even the US in the early part of the century, housing prices have fallen. While the argument is moot today (US House Prices are STILL falling, after more than three years of a downward trend) it remains alive in pockets of the world. Especially the pocket where I live, in Mumbai, where you can't lose money investing in real estate because no one ever has.

Eventually, statistics can influence behavior. If the cricket team believed the past statistic was going to be held true, then they could give up mentally and make it true. If certain technical indicators are believed to work, they will work even more because people buy or sell just about when the indicator says so, marking peaks and bottoms well enough for the indicator to reinforce its usefulness. I often wonder if I look at technicals because I believe in the concept or simply because the trading crowd tends to; the answer is irrelevant.

At some point things break away from the past. Even if you found a statistical indicator that worked phenomenally, could you trust it enough to put all your money into its predictions? The answer, after all the "black swan" events that seem to have swamped us in the last few years, is an emphatic no. As is the answer to the question, "Would you bet all your money on a team led by Dhoni in a World Cup final"?

Source: http://in.news.yahoo.com/blogs/opinions/statistically-losing-world-cup-20110406-005258-974.html

Saturday, April 2, 2011

The Mythematics of Cricket

Cricket is full of hoary statistics, some of them complex, many illogical and in need of reform

- T R RAMASWAM

If ever there was a game created for mathematicians, statisticians, trivia buffs — in short, all mad men — then it must be cricket. It has three formats — Tests, ODIs and T-20s. You have bilaterals, triangulars, World Cups, Champions Trophy. There are umpteen activities on the field — batting, bowling, wicket-keeping, fielding, umpiring, captaincy and now third-umpires and match referees. Football, hockey and rugby have only goals but in this great game, you can get out in 10 different ways and at least five are always the norm. Grounds and crowds have also crept into the statistics. Multiply all the above and you can have a tome of records — even creepy little ones like this — which left-handed bowler has taken the most right-handed batsmen wickets? Which batsman has the largest percentage of lbw dismissals? Each record can have qualifications as to how many innings/matches someone needs to have played to be considered. You can have any number of answers — whether it is the format, home or away, name of tournament, which ground and which countries are involved. There are any number of right answers and even more wrong answers! Quiz competitions usually give 15 seconds for an answer — perhaps we need to impose these limits for quiz-masters in cricket! For years, things were relatively simple — number of runs, number of wickets, averages — that was just about it. But with technology upgrading itself, pie-charts, bar graphs (Manhattans — though Uncle Sam does not play), worms and wagon wheels have all become household words. Then came the Mother Matrix — the exotic combinatrics and probability avail of mayamathics — more difficult than Einstein’s Theory or the Riemann Hypothesis — Duckworth-Lewis to the uninitiated. If you can solve even one problem, the Clay Institute will gladly reward you. Delving into hitherto esoteric terms like resources, constraints (much like a SAP or ERP programme) teams and captains have fallen prey to its machinations and have been reduced to tears by an error of just one run.

It is, however, the various other methods that cricket has appropriated to itself — against the principles of maths and logic — that makes the game even more befuddling. Take for example — margin of victory. In Tests, mercifully there is no ambiguity — one team has to lose all 20 wickets. Even if you declare, it is deemed that you have sacrificed all the remaining wickets. In fact, from 1877-1889, declarations were not allowed. From 1890-1900, declarations could be made only on the third day. Then, in 1901 on the second day, but only after lunch. Only from 1910 onwards did declarations become free. If you wanted to declare before 1910, whenever you wanted, then you had to deliberately get out! Talk about throwing wickets!
But in ODIs and T-20s, we have an odd situation. Here, a team batting first and scoring 200 for no loss loses to the other if they score 201/7. But the margin is stated as 3 wickets although the team batting second has lost more wickets and the margin is expressed as if the first team has lost all its wickets. But has it? Their innings ended only because the number of overs is fixed and it was exhausted. So far, no one has had the courage to declare in an ODI or a T-20! Then is the winning margin expressed logically? If the scores are tied at the end of 50/20 overs, then shouldn’t the team that has lost fewer wickets be declared the winner? Perhaps the number of wickets should become redundant at the end of an innings and it should be deemed that the team has won by so many runs only.

And all winning margins should be expressed as runs — since only runs count and wickets don’t. Thus, in 50/20 overs, one team scores more runs than the other and is the winner by that many runs. The margin will be deemed to be 1 run if the winning team has batted second. Note that net run rate or NRR, perhaps deliberately to ensure a run-fest, takes into account only runs and overs and not wickets. Shouldn’t it — who’s scared of this?
The methodology of calculating a batsman’s average is curious, specially the treatment of not outs. For example, since not-outs are not added to the denominator, a batsman can have an average higher than any of his scores, a paradox! This is indeed new maths! If a batsman scores 30*, 35*, 25* and gets out for 10 in his last innings, he is credited with an average of 100, much more than any of his scores! The third conundrum is how centuries are counted. Double and triple hundreds are counted as only one century and this is patently unfair. A double or triple century requires that much more concentration and physical effort than a single century. In fact the difference is tremendous if one considers the degree of difficulty in scoring double centuries and triple centuries. From 1877 to date, about 2000 centuries, 200 double centuries and a little over 20 triple centuries have been scored. Thus the degree of difficulty increases 10-fold for each increasing century. If this is taken into account and double and triple centuries given appropriate weights, Bradman will still be ahead of Tendulkar and Gavaskar. But then what weight will you give Lara’s 400?!! Any answers? Can we at least begin by counting 200s and 300s as two and three centuries?

Source: The Economics Times, 02/April/2011