Wednesday, January 31, 2007

How much is a stock really worth?

Investment Valuation: A Little Theory

We'll start with a little theory before we get to the calculators.

A company is valuable to stockholders for the same reason that a bond is valuable to bondholders: both are expected to generate cash for years into the future. Company profits are more volatile than bond coupons, but as an investor your task is the same in both cases: make a reasonable prediction about future earnings, and then "discount" them by calculating how much they are worth today. (And then you don't buy unless you can get a purchase price that's less than the sum of these present values, to make sure ownership will be worth the headache.)

Let's take an example. Suppose you are interested in a company that earned $10 per share over the last twelve months. Assume you expect the company to grow over the foreseeable future, so that its earnings will grow at a rate of 8% annually for the next 10 years; then, to play it safe, you make no assumptions about earnings after that, but just expect the company to stay at the same size from then on. Your earnings expectations look like this:

expected future earnings per share

Here the height of each blue bar is the earnings per share that you expect for a particular year in the future. (The first bar is earnings over the next twelve months: that is, it's what you expect the company's reported annual earnings to be one year from now.)

Now for the discounting, finding how much each "blue bar of the future" is worth to you in the present. We'll be using a discount rate of 11%, which is about the average annual return rate of the stock market over the past many decades. The idea is that earnings of $1.11 next year is only worth $1.00 to you right now, since you could invest the $1.00 in the S&P 500 and expect it to grow to $1.11 in one year's time. Finding the present value of all of the blue bars gives a new graph:

present values of future earnings

Here each green bar is the value to you, today, of each corresponding blue bar in the first graph.

If you want to check into this in a little more detail, use the popup calculator in future value mode to find that $10 per share growing at 8% annually will grow to $21.59 in 10 years (that's the height of the blue bar at year 10); and then in present value mode to find that $21.59 10 years from now is worth $7.60 today assuming a discount rate of 11% (that's the height of the green bar at year 10).

We've drawn both graphs with forty bars, but the valuation formulas we'll use in the calculators assume the company will keep going forever: an infinite number of bars. But the key is that the green bars are shrinking so rapidly that, even though there are an infinite number of them, if you stacked them up they would only reach a finite height: in this example, the height would be $155.40. That total - the sum of the present values of all future earnings - is the theoretical value of the investment right now. (See detail.)

How Long is Forever?

The last paragraph said we'd assume earnings would be going on forever into the future - not exactly a realistic assumption. But it turns out that assumption isn't really important: the rapid shrinkage of the green bars means that any contribution from the distant future is negligible. In this example, all earnings after year 50 contribute only about one dollar - less than 1% - to the stock's value today:


What are "Earnings"?

Purists would say that a company is worth the present value of its future free cash flows rather than its earnings. The trouble is that you would have to know a lot about the company (and use fancier calculators!) to find values with FCF. So we'll assume that earnings and free cash flow are equivalent in the long run, and that both approximate real cash profits.

What about Debt?

What does debt do to the value of a company? The quick answer is that any valuation based on earnings has already accounted for debt. That's because interest payments - the "cost" of the debt - are an expense, and have already been deducted from earnings. So if the present value of future earnings adds up to $20 a share, the company's stock is worth $20 a share, regardless of the amount of debt it has.

Of course the real world is more complicated than that glib theoretical answer; for example:

  1. Debt is better than that: interest is an expense, so debt financing gives business a tax break unavailable with other forms of financing.

  2. Debt is worse than that: interest is an absolute obligation, so debt increases the risk that some years will have low reported earnings (not to mention the risk of bankruptcy).

If you put those two contradictory statements together they actually form a coherent whole: Debt is a cheap way for a company to raise capital; and the superior profits that result will be a reward for stock investors willing to accept the added risk.

Friday, January 26, 2007

CS61B: Data Structures and Advanced Programming

Lecture Notes for Algorithmic Analysis I && Data Structures


-1 representation is all ones


x << n is x . 2 power n

x >> n is x / 2 power n rounded down 11111 >> 1 equals 11111 i.e -1/2 = -0.5 is -1 since -0.5 is negative and rounded down giving -1

(x >> 3) & ((1<<5)-1) = 5 bit integer bits 3-7 of x


Program run time is a function of the size of input data

do this for n=1,2,4,16,32,64,1024,2(pow 20)
O(16lgn)
o(sqrt(n))
o(n)
o(nlgn)
o(npow2)
o(npow3)
o(2pow2n)


The O notation is good to tell us how fast the program runs

e.g a single for loop is o(N) since it would take N time in worst case
But the O notation is ambiguous since O is Upper bound so the same for loop is also O(N pow2) so Big O Notation is not good.

But it is good to say Theta Notation than O since theta is the worst case

2 nested for loop are O(nsq)
recusion is O(2(pow n))

Thursday, January 25, 2007

The Fingerprints of Atoms

This is a lecture from the course (Astro C10 / LS C70U Introduction to General Astronomy) was taught at Berkeley by Prof. Alex and here are some notes taken from that lecture

The whole universe is made of the same material as is present on earth mainly hydrogen and helium. How to do we know that?


Well....from the (pattern of lines/spectrum) which act as fingerprints from the
emission or absorption of photos by atoms

Electrons have discrete well defined energy levels.

When we shine a photon on an atom and if it happens be of the right
energy level the electron in that atom can go to a higher energy
level and absorbe this photon. Later it can give that photon back
and emit that same photon. If the electron escapes then the atom is ionized.

2 ways to ionize
- Absorption of a photon (students were throwing balls at the professor)
- Knocking it out by a collision (and how Christina kicked him)

Tuesday, January 23, 2007

Wed 11/30/2005 - The Contents of the Universe

The Wilkinson Microwave Anisotropy Probe (WMAP) is a NASA satellite mission led by Professor Charles L. Bennett of Johns Hopkins University, whose mission is to survey the sky to measure the temperature of the radiant heat left over from the Big Bang did a research and we got a plot of the whole universe which essentially said that the universe has Density Omega =1

But we knew that Matter(measured) was 27% so it was said that the Dark Energy was 73%
Also among Matter real visible matter(protons/neutrons) is 4% so 23 % has to be dark matter

What is Universe Made of?
So in essence 96% of the universe is Dark Energy and Dark Matter!!!!

Big Bang

1. Very Hot

2. Cosmic Background Radiation is coming from 14B light years away in all direction

3. Universe is opaque - all protons and electrons are free

4. 380 000 Years after the bang - p+e are combined and Universe starts transparent at 3000K

5. WMAP said that there was a difference in temperature(1/100000 K) which was the "seeds"
of universe causing differences in densities visible now.

6. 200 000 000 after the bang - Galaxies/Stars start to form and shine

7. Temperature
003 Kelvin - Universe Now (Very Cold)
300 Kelvin - San Diego



14 000 000 000 BC - Big Bang Universe is opaque - all protons and electrons are free

380 000 Years after - p+e are combined and Universe starts transparent at 3000K


??? - there was a difference in temperature(1/100000 K) which was the "seeds" of universe

200 000 000 after - Galaxies/Stars start to form and shine


00 000 006 500 BC - Srimad Bhagawad Gita Recited to Arjun
00 000 003 000 BC - History recorded
00 000 000 000 BC - Christ is Born
00 000 000 030 AD - Christ is Crusified
00 000 001 999 AD - Y2K
00 000 002 007 AD - Now
00 000 003 000 AD -
14 000 000 000 AD - Big Crunch

Course Link

Alex Filippenko

AJAX on mobiles

January 1, 2006

Mobile web 2.0: AJAX for mobile devices – why mobile AJAX will replace both J2ME and XHTML as the preferred platform for mobile applications development

opera.JPG

Recently, Opera announced the availability of AJAX on mobile devices through their browser. Considering the popularity of Opera in the browser market(especially in the mobile browser market), this announcement is indeed very significant and has been picked up by many A-list bloggers such as Russell Beattie and Om Malik

However, I believe there is more at stake here ..

Having been involved in creating mobile services for a few years now, I believe AJAX will replace both J2ME and XHTML as the platform of choice for developing mobile applications.
In this article, I will outline my reasoning.

Before I do so, a caveat – I believe that mobile web 2.0 is far more than ‘AJAX on mobile’. Essentially mobile web 2.0 involves applying all seven of the web 2.0 principles to mobility. I will be discussing mobile web 2.0 in subsequent blogs. For a more complete discussion see my article on mobile web 2.0.

Here, I am discussing AJAX only i.e. only one facet of web 2.0.


Overview
In this article, we will discuss
1) What is AJAX (an overview)
2) Current Mobile applications development models
3) Problems the industry faces (in other words shortcomings of the current mobile applications models) and finally..
4) Why AJAX will replace J2ME and XHTML as the preferred development platform

What is AJAX
AJAX is an optional addition to web 2.0. It is not a single technology. Rather, it’s a combination of a number of existing technologies acting together namely

• XHTML and CSS for standards based presentation
• Document Object Model for dynamic display and interaction
• XML and XSLT for data interchange and manipulation
• XMLHttpRequest for asynchronous data retrieval and
• Javascript to tie everything together

Until AJAX came along, it was not easy to replicate the rich and responsive interaction design of native applications. AJAX is different from other previous attempts in addressing this problem since it is based on existing, non-proprietary standards which are already familiar to developers.

In traditional web applications, most user action triggers an HTTP request. The server does some processing and returns the result back to the user. While the server is processing, the user waits! The ‘start-stop-start’ nature of web applications is good from a technical standpoint but not from a user interaction standpoint (since almost all user interaction is resulting in trips to the server and the user is waiting while the server is doing the work).

AJAX solves this problem by using the AJAX engine. At the start of the session, the AJAX application loads the AJAX engine. The AJAX engine is written in Javascript as a Javascript library and sits in a hidden frame. The user interacts with the AJAX engine instead of the webserver. If the user interaction does not require a trip to the server, the AJAX engine handles the interaction on it’s own. When the user interaction needs some data from the server, the AJAX engine makes a call asynchronously (via XML/XMLHttpRequest API ) without interrupting the user’s flow.

In this sense, AJAX is ‘asynchronous’ because the AJAX engine is communicating with the server asynchronously to the user interaction. Thus, the user gets a seamless experience(i.e. the user is not waiting)

There is a momentum behind AJAX at the moment. Developers are already familiar with the technologies underlying AJAX. All the technologies making up AJAX are mature and stable. AJAX is the foundation for many new applications on the web like Google suggest , Google Maps , some features of Flickr and Amazon’s A9.com

Mobile applications development models and their shortcomings
From the above discussion and from the articles referenced , we can see that - AJAX clearly solves two problems - namely a superior UI and a standardised form of data retrieval.

These two problems also apply to mobile devices and by extension, AJAX addresses them as well.

However, I believe that it does far more!

Specifically, it solves the following problems in the mobile context.

a) The problem of market fragmentation
b) Porting woes (specific to downloading applications like those built on J2ME)
c) Application distribution without ‘walls’

Besides, it has the developer community behind it – which is a significant plus!

Lets consider existing mobile applications development. There are two principal ways to categorise mobile applications – Browsing applications and Downloading applications. There are others(like Messaging applications, SIM applications and embedded applications) - but a vast majority of the applications we see today fall under downloading or browsing applications.

Browsing applications: Browsing applications are conceptually the same as browsing the web but take into account limitations which are unique to mobility (for example - small device sizes). Similar to the web, the service is accessed through a microbrowser which uses a URL to locate a service on a wireless web server. The client is capable of little or no processing.

Downloading applications (Smart client applications) : In contrast to browsing applications, downloading applications are applications that are first downloaded and installed on the client device. The application then runs locally on the device. Unlike the browsing application, a downloaded(or smart client) application does not need to be connected to the network when it runs. Downloading applications are also called ‘smart client’ applications because the client(i.e. the mobile device) is capable of some processing and / or some persistent storage(caching). Currently, most Java based games are downloaded applications i.e. they are downloaded to the client, require some processing to be performed on the client and need not be always connected to the network. Enterprise mobile applications such as sales force automation are often also examples of smart client applications.

J2ME is the most common mode of developing downloading applications and XHTML is most common way of developing browsing applications.

Let us elaborate on the problems I have outlined before and then discuss how AJAX will solve them – potentially making XHTML and J2ME less relevant.

Problem One - Market fragmentation
Mobile applications are primarily consumer applications. The mobile data industry is an emerging industry. As with many industries in this phase of evolution, it is fragmented.
To be commercially viable (especially considering the need for the network effect ), consumer applications need a large target audience.

This can come about either by a single proprietary standard such as BREW from Qualcomm (which obviously has it’s disadvantages) or through open standards not controlled by any one entity with few industry barriers.

To illustrate how market fragmentation affects commercial viability of a new service, I often recommend the following approach (Most of the figures can be easily obtained from the web).

The idea is to think in terms of ‘concentric circles’ in trying to find out the target audience for your application. A sample set of steps I use is as below

a) What is the population of the country where you are launching your application?
b) What is the percentage of handset penetration amongst this population?
c) Which operators are you targeting within this population? (Most countries have more than one mobile operator)
d) Which handsets are you targeting within this population (not all operators support all handsets)?
e) What is the technology of deployment for example Java, SMS, WAP etc?
f) Does the application have any special technology needs such as location-based services? How many people have handsets equipped with this technology?
g) What does a segmentation analysis of the subset reveal? (Simplest segmentation is male/female. Prepay/postpay etc)
h) What are the channels to market for the segments we are targeting?
i) What proportion of this subset do we expect to hit and convert to customers based on our marketing budget?(i.e. the conversion rate which can be typically 2% )

This will give you your target audience.

Thus, this target audience times number of potential downloads per month should give you an idea of your monthly revenue. This could then be tied against your cost base including your development costs, porting costs etc to arrive at a more tangible picture of success/failure of the new service.

The above methodology illustrates the problem of fragmentation and it implies that very few mobile services are profitable today. Thus, we have a proliferation of ‘broadcast content applications’ – ex ringtones, pictures but very few utility applications at a mass-market level.

Problem two - Porting woes
This problem is specific to downloaded applications (and more commonly J2ME). Write once run anywhere is a joke in the mobile context! – and through no fault of Sun ..

Consider the case of mobile games(a downloaded application) typically developed using J2ME.

First the good news ..
• Carriers such as Sprint and Vodafone report that mobile games and other data services now account for roughly 10 percent of their annual revenues;
• Industry consulting firm Ovum notes that there are now more than 450 million Java-enabled handsets globally, in addition to the 38 million and 15 million BREW- and Symbian-enabled handsets;
• Mobile-game publishers racked up $1.2 billion in global sales in 2004 and expect an even stronger year in 2005 as more and more consumers discover the tiny gaming consoles already in their pockets.

BUT then the pitfalls ..
Game porting generally requires developers to adapt to differences in screen resolution, processor speed, memory thresholds, and sound capabilities, all of which can vary wildly from device to device. For publishers, this can not only exponentially increase game development and asset creation time, but can also cause them to miss critical time-to-market windows in a hyper-competitive industry. As an example, imagine that you are a mid-sized game publisher with 30 games in your portfolio. To make your games available worldwide in five languages and on only 50 devices, you would need to create 7,500 different builds. At $2,500 per build, you would require a budget of nearly $19 million simply to handle porting.

This limits the business model severely and very few mobile games are profitable.
(original source for this section as per my blog Porting – the big barrier to entry with acknowledgements to Sameer Bhatia as per the blog)

Problem three - Application distribution without walls
The predicament of using J2ME as per the preceding example shows that it’s not enough to merely set up a community process as Sun has done (which works fine as far as the technology is concerned). The technology and the applications built upon it must remain homogeneous and interoperable to enable the network effect and gain critical mass. The fewer the ‘choke points’ for a platform – the better it is for the industry as a whole.

We will discuss this more in the next section(where we talk of how AJAX could address this problem).

Why will AJAX replace J2ME and XHTML as the preferred development platform? Can AJAX solve the preceding problems?

In my view .. YES

AJAX is accessed through the browser. There are two ways a customer can get the browser – either the browser can be pre-installed on the phone by the manufacturer or it can be installed as a separate application

Anyone can download a browser for a smartphone as this Opera link shows for series 60 phones

This means, all customers can potentially install their own browser and if enough people do – we have critical mass with few ‘choke points’ – such as specific restrictions created by mobile operators. In other words, a means to bypass the walled garden.

Further, AJAX offers a superior user experience and already has the developer community supporting it. The possibility of attaining critical mass (due to fewer choke points) means more chance of monetising the application – leading to a virtuous circle of better applications.

J2ME as it stands today, is seriously flawed(not the technology but the business model). XHTML will be an ‘also ran’ because AJAX will offer a superior user experience.

Hence, my belief that AJAX will be the preferred platform of choice for mobile applications at the expense of J2ME and XHTL.

Supporting notes
a) I have said ‘preferred’ and not ‘replace’ i.e. I don’t expect AJAX to replace any technology

b) AJAX won’t solve all problems. You still need to create a service which is useful for mobile customers

c) AJAX is not the only attempt to create a better interface. There have been others with limited success but they are not across the industry(or are proprietary). For example mobile SVG from bitflash , superscape’s swerve technology for 3D gaming (which is the implementation of JSR 184 - Mobile 3D Graphics API for J2ME™ ) and macromedia mobile

d) Not a lot of people are actually browsing the mobile internet. Although WAP usage shows phenomenal growth, these figures include the use of WAP as a transport mechanism – typically for downloading content. In other words, every time you download a ringtone, you implicitly create a WAP page impression. I suspect the real figures used by consumers to actually browse the mobile internet are very low

e) Very few mobile operators have tried to engage with the developer community as such. Practically the only example I can think of is source o2

f) The plight of small developers can be illustrated from my discussions with a Korean vendor when I spoke at imobicon in Seoul. The vendor had finally managed to get his game listed on a UK portal. However, that was because – a Korean aggregator managed to get a deal with a UK aggregator. Thus, he now had two aggregators and one operator taking a slice of revenue! Leaving him with very little. A sad state of affairs. Surely, there must be a way to create and distribute applications globally i.e. you write for the browser and anyone who uses that browser can download and run your application

g) Mobile operators often argue that they handle billing and location services etc. That’s fine – but let’s first worry about getting the numbers. Also, billing comes at a cost and there may be better billing mechanisms on the web.

Conclusions
To recap, Mobile applications are primarily consumer focussed. They need critical mass. Currently, the market is fragmented and the current commercial model is broken.

AJAX offers a potentially better solution in comparison to the incumbents (J2ME and XHTML) due to a combination of fewer potential choke points because of its distribution mechanism. The economic models do not favour J2ME and AJAX offers a superior user experience to XHTML. It has the support of the developer community.

Finally, note that I say AJAX will be ‘preferred’ model and not the ‘only’ model. I don’t expect AJAX to replace either J2ME or XHTML.

Comments welcome: Ajit.Jaokar at futuretext.com

Useful links: Opera AJAX announcement
Dion Hinchcliffe's The Incredible Ongoing Story of Ajax

Image source: www.opera.com
Permanent Link: http://opengardensblog.futuretext.com/archives/2006/01/mobile_web_20_a.html

Posted by ajit at January 1, 2006 11:04 PM

Monday, January 22, 2007

Stock Market Models

In the mathematics of probability, a stochastic process is a random function. In the most common applications, the domain over which the function is defined is a time interval (a stochastic process of this kind is called a time series in applications) or a region of space (a stochastic process being called a random field).

Familiar examples of processes modeled as stochastic time series include stock market and exchange rate fluctuations

However, sometimes the market is also modelled as Brownian Motion, Continuous time Markov Process(Random Walk) or a Gauss-markov Process. Most of the time the time series model will fit however.

Friday, January 19, 2007

Software Practices

Remember the Basics. There are many factors involved in developing excellent software. Literate programming is just a single technique to be used along with all the other well established software engineering practices. Here are some software practices related to program documentation:

* Establish structures, processes, and outcomes (see Luke Holman).
* Generate software requirements and design description (see IEEE standards).
* Practice object oriented design.
* Choose class names, function names, and variable names wisely.
* Avoid duplicate code by creating shared functions.
* Re-think or refactor code which is difficult to understand.
* Develop small classes and small functions when feasible.
* Keep it simple and straight forward as much as possible.
* Organize large source code files using an outlining editor (Leo).
* Comment source code effectively with header and in-line comments.
* Document source code using an API documentation standard (doxygen).
* Utilize pre-conditions and post-conditions using assertions.
* Provide formal or informal proofs of source code correctness.
* Conduct peer reviews of deliverables (software, documentation, source code).
* Implement automated unit testing which is also a form of documentation.
* Examine source code metrics (lines, complexity, etc).
* Execute static analysis for common coding errors.

Measurement in Software Engineering

A Software Metrics Primer

Karl E. Wiegers

My friend Nicole is a quality manager at Motorola, a company widely known for its software process improvement and measurement success. Once I heard her say, "Our latest code inspection only found two major defects, but we expected to find five, so we’re trying to figure out what’s going on." Few organizations have enough insight into their software development and project management efforts to make such precise statements. Nicole’s organization spent years making its processes repeatable and defined, measuring critical aspects of its work, and using those measurements to set up well-managed projects that develop high-quality products.

Software measurement is a challenging but essential component of a healthy and highly capable software engineering culture. In this article, I describe some basic software measurement principles and suggest some metrics that can help you understand and improve the way your organization operates. Plan your measurement activities carefully because they can take significant effort to implement and the payoff will come over time.


Why Measure Software

Software projects are notorious for running over schedule and budget, yet still having quality problems. Software measurement lets you quantify your schedule, work effort, product size, project status, and quality performance. If you don’t measure your current performance and use the data to improve your future work estimates, those estimates will just be guesses. Because today’s current data becomes tomorrow’s historical data, it’s never too late to start recording key information about your project.

You can’t track project status meaningfully unless you know the actual effort and time spent on each task compared to your plans. You can’t sensibly decide whether your product is stable enough to ship unless you’re tracking the rates at which your team is finding and fixing defects. You can’t quantify how well your new development processes are working without some measure of your current performance and a baseline to compare against. Metrics help you better control your software projects and learn more about the way your organization works.


What to Measure

You can measure many aspects of your software products, projects, and processes. The trick is to select a small and balanced set of metrics that will help your organization track progress toward its goals. Goal-Question-Metric (GQM) is an excellent technique for selecting appropriate metrics to meet your needs.. With GQM, you begin by selecting a few project or organizational goals. State the goals to be as quantitative and measurable as you can. They might include things like:

  • Reduce maintenance costs by 50% within one year
  • Improve schedule estimation accuracy to within 10% of actual
  • Reduce system testing time by three weeks on the next project
  • Reduce the time to close a defect by 40% within three months.

For each goal, think of questions you would have to answer to see if you are reaching that goal. If your goal was "reduce maintenance costs by 50% within one year," these might be some appropriate questions:

  • How much do we spend on maintenance each month?
  • What fraction of our maintenance costs do we spend on each application we support?
  • How much money do we spend on adaptive (adapting to a changed environment), perfective (adding enhancements), and corrective (fixing defects) maintenance?

Finally, identify metrics that will let you answer each question. Some of these will be simple data items you can count directly, such as the total budget spent on maintenance. Other metrics you will compute from two or more data items. To answer the last question listed previously, you must know the hours spent on each of the three maintenance activity types and the total maintenance cost over a period of time.

Notice I expressed several goals in terms of a percentage change from the current level. The first step of a metrics program is to establish a current baseline, so you can track progress against it and toward your goals. I prefer relative improvement goals ("reduce maintenance by 50%") rather than absolute goals ("reduce maintenance to 10% of total effort"). You can probably reduce maintenance to 10% of total effort within a year if you are currently at 20%, but not if you spend 80% of your effort on maintenance today.

Your balanced metrics set should eventually include items relating to product size, product quality, process quality, work effort, project status, and customer satisfaction. Table 1 suggests metrics that individual developers, project teams, and development organizations should consider collecting. You would track most of these over time. For example, your routine project tracking activities should monitor the percentage of requirements implemented and tested, the number of open and closed defects, and so on. You can’t start with all of these, but I recommend including at least the following measurements early in your metrics program:

  • Product size: count lines of code, function points, object classes, number of requirements, or GUI elements
  • Estimated and actual duration (calendar time) and effort (labor hours): track for individual tasks, project milestones, and overall product development
  • Work effort distribution: record the time spent in development activities (project management, requirements specification, design, coding, testing) and maintenance activities (adaptive, perfective, corrective)
  • Defects: count the number found by testing and by customers and their type, severity, and status (open or closed)

Creating a Measurement Culture

Fear is often a software practitioner’s first reaction to a new metrics program. People are afraid the data will be used against them, that it will take too much time to collect and analyze the data, or that the team will fixate on getting the numbers right rather than building good software. Creating a software measurement culture and overcoming such resistance will take diligent, consistent steering by managers who are committed to metrics and sensitive to these concerns.


Group

Appropriate Metrics

Individual Developers

  • Work effort distribution
  • Estimated vs. actual task duration and effort
  • Code covered by unit testing
  • Number of defects found by unit testing
  • Code and design complexity

Project Teams

  • Product size
  • Work effort distribution
  • Requirements status (number approved, implemented, and verified)
  • Percentage of test cases passed
  • Estimated vs, actual duration between major milestones
  • Estimated vs. actual staffing levels
  • Number of defects found by integration and system testing
  • Number of defects found by inspections
  • Defect status
  • Requirements stability
  • Number of tasks planned and completed

Development Organization

  • Released defect levels
  • Product development cycle time
  • Schedule and effort estimating accuracy
  • Reuse effectiveness
  • Planned and actual cost

To help your team overcome the fear, you must educate them about the metrics program. Tell them why measurement is important and how you intend to use the data. Make it clear that you will never use metrics data either to punish or reward individuals (and then make sure that you don’t). A competent software manager does not need individual metrics to distinguish the effective team contributors from the slackers.

Respect the privacy of the data. It is harder to abuse the data if managers don’t know who the data came from, Classify each data item you collect into one of these three privacy levels:

  • Individual: only the individual who collected the data about his or her own work knows it is his or her data, although it may be pooled with data from other individuals to provide an overall project profile
  • Project team: data is private to the members of the project team, although it may be pooled with data from other projects to provide an overall organizational profile
  • Organization: data can be shared among all members of the organization.

As an example, if you are collecting work effort distribution data, the number of hours each individual spends working on every development or maintenance phase activity in a week is private to that individual. The total distribution of hours from all team members is private to the project team, and the distribution across all projects is public to everyone in the organization. View and present the data items that are private to individuals only in the aggregate or as averages over the group.

Make It a Habit

Software measurement doesn’t need to be time consuming. Commercial tools are available for measuring code size and complexity in many programming languages. Activities like daily time tracking are more of a habit than a burden. Commercial problem tracking tools facilitate counting defects and tracking their status, but this requires the discipline to report all identified defects and to manage them with the tool. Develop simple tracking forms, scripts, and web-based reporting tools to reduce the overhead of collecting and reporting the data. Use spreadsheets and charts to track and report on the accumulated data at regular intervals.

Tips for Metrics Success

Despite the challenges, many software organizations routinely measure aspects of their work. If you wish to join this club, keep the following tips in mind.

Start Small. Because developing your measurement culture and infrastructure will take time, use GQM to first select a basic set of initial metrics. Once your team becomes used to the idea of measurement and you have established momentum, you can introduce new metrics that will give you the additional information you need to manage your projects and organization effectively.

A risk with any metrics activity is dysfunctional measurement, in which participants alter their behavior to optimize something that is being measured, rather than focusing on the real organizational goal. For example, if you are measuring productivity but not quality, expect some developers to change their coding style to expand the volume of material they produce, or to code quickly without regard for bugs. I can write code very fast if it doesn’t actually have to run correctly. The balanced set of measurements helps prevent dysfunctional behavior by monitoring the group’s performance in several complementary aspects of their work that lead to project success. Never attempt to use metrics to motivate performance.

Explain Why. Be prepared to explain to a skeptical team why you wish to measure the items you choose. They have the right to understand your motivations and why you think the data will be valuable. Use the data that is collected, rather than letting it rot in the dark recesses of a write-only database.

Share the Data. Your team will be more motivated to participate in measurement activities if you inform them about how you’ve used the data. Share summaries and trends with the team at regular intervals and get them to help you understand what the data is telling you. Let them know whenever you’ve been able to use their data to answer a question, make a prediction, or assist your management efforts.

Define Data Items and Procedures. It is more difficult and time-consuming to precisely define the data items and metrics than you might think. However, if you don’t pin these definitions down, participants may interpret and apply them in different ways. Define what you mean by a "line of code," spell out which activities go into the various work effort categories, and agree on what a "defect" is. Write clear, succinct procedures for collecting and reporting the measures you select.

Understand Trends. Trends in the data over time are more significant than individual data points. Some trends may be subject to multiple interpretations. Did the number of defects per function point found during system testing decrease because the latest round of testing was ineffective, or did fewer defects slip past development into the testing process? Make sure you understand what the data is telling you, but don’t rationalize your observations away.

Measurement alone will not improve your software performance, but it provides information that will help you focus and evaluate your software process improvement efforts. Link your measurement program to your organizational goals and process improvement program. Use the process improvement initiative to choose improvements, use the metrics program to track progress toward your improvement goals, and use your recognition program to motivate and reward desired behaviors.

Further Reading

My book, Creating a Software Engineering Culture (Dorset House, 1996) includes an overview of software metrics and a case study on software work effort measurement. Robert Grady’s Practical Software Metrics for Project Management and Process Improvement (PTR Prentice Hall, 1992) describes a world-class metrics program developed at Hewlett-Packard. Applied Software Measurement, Second Edition, by Capers Jones (McGraw-Hill, 1996) is a comprehensive treatise on metrics that includes industry averages for productivity and quality.

More Articles on Software Engineering by the same Author

Programmer Productivity

Robert Martin has a post about how 10% of programmers write 90% of the code. I think this is more-or-less accurate, but he seems to think that whether a programmer is a member of the elite or not is an innate quality -- that there are good programmers and poor programmers, and nobody ever moves between the two groups.

I have worked on projects where I've been in the elite, and I've worked on projects where I've been in the middle, and on occasion I even qualify as a Waste Of Space for a month or two. There are several factors that influence how productive I am, personally.

First, the fewer developers in the group, the better. This is more than just being a big fish in a little pond, it's about feeling responsible for the code. If I'm in a group of 20, my contribution doesn't matter as much as if I'm in a group of four, so I don't care as much.

Second, distractions must be minimized. I enjoy helping people and answering questions, but they really cut into my concentration. Unfortunately, it's rude to ask people to use email instead of popping over for a visit or sending an instant message. Also, if I'm in an environment where I have meetings every day, scheduled such that they break my time up into hour-long chunks, then my attention is guaranteed to wander. For this reason, I tend to work best at night.

Third, history and familiarity with the code is very important. In code I've written and/or rewritten, I'm extremely productive. In code that I'm unfamiliar with, I'm not. It also helps a lot if the person who did write the code is willing to take the time to answer questions, without getting irritated. I also find that different people write the same program in vastly different ways, and if you're working on a codebase that was architected very differently from the way you would have done it, it can be difficult to ever get comfortable.

Fourth, management is important. For example, I need to feel just enough time-pressure to make me pay attention, but not so much that I give up in despair. I also need to get feedback as to how my work is perceived by users (did it suck? did it rock?) otherwise my work starts to seem pointless and I lose motivation.

Fifth, I find that my productivity has ceased to improve noticeably over time. For the first two or three years it improved dramatically, but since then I seem to have plateaued. (I currently have eight years of professional programming experience.)

If you work with someone who you think is being unproductive, perhaps you should spend some time to find out why. You might find that a very small change in their work environment can lead to a large improvement in their output. Maybe they just want to know that their code is actually useful to someone. Maybe they need free snacks, so their blood sugar doesn't get too low in the afternoon. Maybe the need to work in a quieter part of the office.

Discovering and addressing these kinds of things should be 50% of what a manager does. The other 50% should be facilitating communication both within the group and with other groups.

Thursday, January 18, 2007

Research Areas

Financial Modelling and Computational Finance: Particularly interested in the pricing of various financial derivatives such as options and convertible bonds. Developing new analytical and numerical solutions.

* Computational finance
* Statistical decision theory
* Time series / cointegration
* Statistical quality control
# The theory of Inference on stochastic processes
# The quasi-likelihood method and its applications
# The theory of stochastic analysis and its applications in finance
# Time series analysis
# Long-memory processes
# Cointegration analysis and its applications
# GARCH models and GARCH-X models
# Mathematics Finance
# Bioinformatics
# Confidential data
# Survey methodology


* Long run equilibrium dynamics in financial asset pricing series
* Statistical arbitrage modelling in derivatives markets
* Hedge fund dynamics
* Neural networks in financial forecasting
* Pricing of American Options and moving boundary value problems
* Computational finance
* Convertible bonds and Asian Options
* Partial differential equations governing prices of financial derivatives such as bonds and options
* Stochastic differential equations for underlying variables such as interest rates and stocks
* Behavioural finance
* Empirical data analysis
* Inference in stochastic processes
* Time series analysis
* Co-integration analysis and applications
* Long memory processes
* GARCH models and inference on herteriscdestic models
* Quasi-likelihood method and its applications
* Sample survey analysis
* Inferences on stochastic processes
improving the Modelling of the Distributional Properties of Financial Time Series
Optimal Data Mining Approach to Time Series Analysis

MIT Prof Gilbert Strang's 18.085 Lecture 1

Video Lectures

Applied mathematics has two parts
1. Find the equation
2. Solve the equation


When we find the equation we then get a matrix


Properties of

Symmetric matrix (i.e. K = K Transpose)

Has an inverse can't say by just glancing it i.e. Non-Singular

Tri-Diagonal (only main diagonal and one each above and below)

Constant Diagonal (same numbers on diagonal). We can do a lot with Fourier Analysis on these kind of matrices

Positive Definite Matrix - has n pivots and all n positive pivots
All n EigenValues are Positive
(Any Vector X) * Matrix * (Transpose of Vector X) is also positive

How to tell if matrix is invertible?

Solutions

1. Check itz Determinant. Determinant is not zero for invertible matrix
2. B.x=0 i.e there is a matrix x not equal zero that takes B to Zero
3. Pivots are never zero




Solve equations by

Matrix = Lower Triangular * Symmetric Diagonal * Transpose of Lower Triangular


Four Pillars of Linear Algebra
1. Elimination
2. Grams-Schmidt
3. Eigenvalue
4. Fourier Analysis

Monday, January 15, 2007

Theory of Everything - Explains the Universe

Theory of General Relativity is useful for describing the interactions of large bodies i.e the world as we see today.

Electromagnetic Theory(EM) - Comes from Maxwell in four equations. Described the similarity of Electricity and Magnetism.

Strong Nuclear Theory(S) - Describes the interaction of protons and neutrons in an atomic nucleus

Weak Nuclear Theory(W) - Describes the interactions of the electrons

According to Einstien, there has to be a unified theory for all these 4 different theories.

Now Scientists have combined the EM,S and W theories into one theory called the standard model.

The answer to a single theory is now believed to exist in the Sting Theory

String theory - everything in the universe is made of tiny vibrating strings.
But there were not one but five theories that could be possible each giving a unique number 496.

Edward witten unified them into M-Theory as saying that these are just 5 ways of looking at it or just like 5 dimensions

In fact he said there are 11 dimentions for the String-Theory and this is called the M-Theory (Magic/Mother theory)


Now there are particle physics labs at FermiLab and CERN that are in search of these seven particles. Gravitons and S particles etc

Saturday, January 13, 2007

Cellular Statistics for 2009

Cellular Users in 2004 were 2.1 Bil and in 2009 they will go to 2.8 Bil

So till 2009 700 mil new users will be added
Out of that
50% in Asia(India/China mainly),
10% each US,East Europe and Latin America
6 % Africa
3% each Middle East and West Europe


World Penetration of mobile users is 15% in 2001 33% in 2004 will move to 42% in 2009



Datacards in the world will grow from 4 mil in 2004 to 15 mil in 2009 (with 5 mil in US)


Operator Revenue moves from $586 Bil to $713 Bil 2009


In 2009
GSM users will move up from 76 to 82%
CDMA will move from 14 to 17%


WCDMA handset sales as a percent of total handsets sales will increase from 5% in 2004 to 35% in 2009

Thursday, January 11, 2007

Japan

Japan is getting 40% of worlds LNG
It is going to australia for LNG

Iran's Azadegan Oil Field cancelled by Japan due to US pressure
Saudi , UAE and Iran(14%) supply 85% of Japanese Oil
Japan also going to Libya, brazil, indonesia etc now

Histograms

Standard Deviation(SD) measures spread
Normal Distribution has a standard unit with avg=0 and SD=1

Multiply by any positive constant
SD,avg,med all get multiplied by that constant. The whole curve gets stretched

Add/subtract a positive constant
SD and avg get added by that value and SD remains the same. Think of it as moving the bell curve to left or right as a whole

Scatter diagram or scatter plots


Corelation coeff(r) tells us how closely two variables are related in terms of a straight line.
It is always between -1(any line with negative slope) and +1(any line with positive slope). A value of 0 means that they are really not related thru a line so it is like a cloud of data.


Add/subtract a positive constant to one or both variables
SD remains the same so r stays the same

Multiply by any positive constant to one or both variables
SU is not changing so r stays the same

Monday, January 8, 2007

Resolutions to Ponder Upon

  • Trade less. Exercise more patience.

  • Be patient, buy right and buy big.

  • Be sure, be not afraid.

  • Don't sell out on fear at the bottom of corrections.

  • Only make pre-planned trades; do not chase the "stock of the day"

  • Learn everything I can from others who know far more than me. Try to apply what I have learned in a more consistent way. With more discipline.

  • Investigate before you invest.

  • Don't fight the tape.

  • I am paid to wait for the best opportunities.

  • Work harder, trade less, research more, be patient.

  • Keep your feet on the ground and expections reasonable.

  • Sell when all the news too good and buy when all the news too bad.

  • Stop listening to experts.

  • The market will always be there and so will good opportunities.

  • Plan the trade and stick to the trading plan.

  • Keep educating yourself. It never stops.

  • You do not have to be "in" the market all of the time.

  • Do more homework.

  • Create lists of stocks that will perform well when any type of news is released and constantly evaluate those lists.

  • Devote more time.

  • To learn more from those that succeed.

  • Pick my trades more carefully.

  • Don't let one or two day counter-trends influence decisions that were made with a medium term goal.

  • Maintain focus and a positive mindset.

  • Let my trades go at the end of the day and enjoy life to its fullest.

  • Do not trade on emotion.

  • Be willing to be in cash.

  • Cut losses more quickly.

  • Observe my thinking/mind during the trading day.

  • Make a plan and follow the plan. Otherwise, do nothing.

  • Stick with one approach.

  • Trade more to my strengths.

  • Remember "it's money and not my ego."

  • Take small profits if nervous.

  • Always have a pre-planned exit point on bad trades.

  • Step back from the noise and spot the longer term trends.
  • Boring is better.
  • Selling too early is better than selling too late.
  • Trust my instincts.
  • Narrow my focus - eliminate all distractions.
  • If wrong - admit it and move on.
  • Trade fewer stocks.
  • Don't buy stocks just because you think it's cheap.
  • Learn to trust the signals of patient, well-resarched strategies.
  • When all the indicators say buy, BUY! Don't hesitate!
  • Learn to outperform the market while preserving capital.
  • Play the devil's advocate on every trade.
  • Be smart! Be nimble! Be quick!
  • Customize my trading system to fit my personality.
  • Keep meticulous records current and reevaluate every trade. Ask what went right; what went wrong; what did I learn for each trade.
  • Find a trading niche.
  • Stop repeating the same mistakes.
  • Think less - just revert to being a trend following moron.
  • Set reasonable goals.
  • Be more consistent.
  • Discipline, not emotion.
  • Plan your work and work your plan.
  • Diversify globally.
  • Eat less. Exercise more. You are right - health is more important.
  • Integrate a shock collar with my trading screen that would issue a jolt every minute once my stock fell below a pre-determined threshold thereby forcing me to take losses when I know I should take them.
  • Don't get caught losing a decent profit trying to make a great profit.
  • Work harder and smarter.
  • No strategy works forever.
  • Hang tight and give myself time to experience and learn. Don't rush ahead.
  • Keep all trades on a tight leash.
  • Never move a stop.
  • Cut my losses, cut my losses, and cut my losses.
  • Make every trade my best trade.
  • Do more sector analysis.
  • Keep a better eye on things.
  • Win every month--doesn't have to be much, just not down.
  • Spend 30 minutes every day on my trading journal.
  • Develop an easy and steady temperament.
  • Stop comparing your performance to the indexes in the short-term.
  • Save, save, save and get ready to pounce when it drops.
  • Write down my trading plan.
  • Set aside a period of daily uninterruptible quality time to reflect and strategize.
  • I need to keep better records.
  • Don't make stupid trades following the hype.
  • Don't try to hit the home runs.
  • Keep reading but take everything with a grain of salt.
  • Get up earlier in the morning, exercise and relax more.
  • Get more serious and professional about my trading.
  • Remember what's important. And it has nothing to do with the stock market.
  • Sell and move on. Quit fretting about what I've left on the table.
  • Be more disciplined, more conservative, more evaluative, more prudent, more selective, more wise, more wealthier.
  • Spend more time planning for my family's future.
  • Don't make decisions by looking in the rear view mirror (old financials or priced in info).
  • Size positions at 2% level.
  • Buy stocks only in large corrections.
  • Become more self-reliant.
  • Having the courage to be not bothered by daily market fluctuations.
  • Play the game well and the goals will come.
  • Be quick to adapt to any market condition.
  • Take a simple idea, and take it seriously.
  • Incorporate a better exercise plan into my trading day.
  • Focus more on ETFs.
  • Trade what I see rather than what I think.
  • Get as much information available, then trust yourself.
  • Study more, save more, consume less.
  • Be better at gettin while the gettin is good.
  • Listen to myself...we are, after all, our best source.
  • Don't lose money.

Sunday, January 7, 2007

Trade for a Living Summarized

  • Write a reason to enter a trade and write a reason to exit it
  • Identify the entry price for a trade and capture the chart pattern for it at that time
  • Identify the exit point of the trade and capture the chart pattern when you exit
  • By analyzing the stock you need to find the balance of power between bulls and bears
  • After a trade write down what indicators were useful for this situation
  • Keep a before and after notebook along with the chart patterns before entry and after exit

Stop Losses

  • Put a stop loss order around 5% of the trade amount value
  • Once the trade is made you are under water. So try to get to breakeven point and then adjust the stop to go to breakeven point
  • After you made profits again adjust the stop order to keep your profit intact

Support and Resistance
  • Draw a line through the upper and lower edges of congestion areas. The bottom marks the support and the top denotes the resistence
  • At the support the buyers are in control
  • At resistence the sellers are in control
  • Support and Resistence are strengthened by time. A weekly time frame is more reliable
  • Tighten your stops when the trend you are following approaches support or resistence
  • A trend reveals its health on how it reacts to Support/Resistence
  • If it penetrates the S/R it continues in the direction of breakout
  • Traders usually buy at breakout (on high volume) and put a stop in the middle of trading range which defines a clear exit point of a false breakout
Trendlines
  • Uptrend is higher highs and higer lows
  • Downtrend means lower lows and lower highs
  • The most important message of a trendline is the direction of itz slope
  • When slope is positive go long and if it is negative go short
  • Sometimes price breaks the trendline but then approaches it back from below. This is the perfect time for a short since the trend has reversed
  • If the uptrend becomes a downtrend short only when the price approaches the trendline from below since this keeps the risk low in case you are wrong
  • The important factor is also the angle of the trendline
  • To identify a trend reversal, find the lowest low (C) and the highest high. Draw the line between the highest high and the inermediate high(B) just before the lowest low. The price break above this downtrend line is the first indication of a trend reversal. The price will now rally to a point A (lower than B) and then retest this lowest low (C) on low volume. It will again try to rally towards point A and when it breaks the barrier at A that is the last opportunity for you to buy. Ideally you should buy if the price retests C on low volume and holds there and move up towards A.
  • Volume must increase in the direction of the trendline
  • Volume must decrease as the price pulls back to the trendline this is healthy pull-back
  • If the volume increase on a pull back to the trendline that is a warning signal of a potential break
  • If the volume decreases as the prices increase away from the trendline, that is also a sign of warning that the trend is becoming weaker
  • A break in trendline gives an opportunity to short when price rellies towards the trendline from below on low volume
Chart patterns
  • Rectangle - Defines a trading range. A break is possible in any direction. Wait for a pull back on low volume after a break.
  • Ascending Triangle - This has a flat upperbound and an increasing lower bound. The flat top means that bulls are maintaining their strength and a increase lower slant means that the bears are losing power. This is a bullish pattern
  • Descending Triangle - This has a flat lower boundary and a decreasing upper boundary. The lower flat bound means that the bears are maintaining pressure but the slant on the top bound means that bulls are losing the game. This is a bearish pattern.
  • Fourier analysis is used to find cycles in large amount of data
  • Maximum Entropy Spectral Analysis is also used
MACD

  • MACD rising from below zero -> Sow the seeds/buy since this is Spring
  • MACD rising crossing above zero -> Water the plants/hold or sell as this is Summer
  • MACD falling from above zero towards centreline -> Sell/Sell Short this is Fall season
  • MACD falling below zero and going down -> Cover shorts and prepare for the next Spring

Volume

  • High volume confirms trends. Price and volume must go together to confirm the trend
  • If the market falls on high volume "climax bottom", it will usually be tested again on low volume. That is the best entry point
  • If the volume shrinks as the trend continues, the trend is bound to reverse soon



Retracements

  • Retracements of 61.8% means a trend change
  • Retracement of 38.2 means a healthy pullback
  • Crazy moves give back at least 50% of the gain back



Cube Count


Look at the picture of the cube made up of blocks. Each of the blocks in the cube has a different number. Some of the numbers are not visible.

  • Numbers 9 and 13 are directly under number 16.
  • Number 22 is between numbers 9 and 6.
  • Number 17 is next to number 5 and 13, but it is not next to number 19.
  • Number 15 is next to number 24 and number 27.
  • Number 20 is above number 15.

What number block is in the middle of the cube with no sides exposed to the outside of the cube?




Answer = Five

How to Be Productive

"With all the time you spend watching TV," he tells me, "you could have written a novel by now." It's hard to disagree with the sentiment -- writing a novel is undoubtedly a better use of time than watching TV -- but what about the hidden assumption? Such comments imply that time is "fungible" -- that time spent watching TV can just as easily be spent writing a novel. And sadly, that's just not the case.

Time has various levels of quality. If I'm walking to the subway station and I've forgotten my notebook, then it's pretty hard for me to write more than a couple paragraphs. And it's tough to focus when you keep getting interrupted. There's also a mental component: sometimes I feel happy and motivated and ready to work on something, but other times I feel so sad and tired I can only watch TV.

If you want to be more productive then, you have to recognize this fact and deal with it. First, you have to make the best of each kind of time. And second, you have try to make your time higher-quality.

Spend time efficiently

Choose good problems

Life is short (or so I'm told) so why waste it doing something dumb? It's easy to start working on something because it's convenient, but you should always be questioning yourself about it. Is there something more important you can work on? Why don't you do that instead? Such questions are hard to face up to (eventually, if you follow this rule, you'll have to ask yourself why you're not working on the most important problem in the world) but each little step makes you more productive.

This isn't to say that all your time should be spent on the most important problem in the world. Mine certainly isn't (after all, I'm writing this essay). But it's definitely the standard against which I measure my life.

Have a bunch of them

Another common myth is that you'll get more done if you pick one problem and focus on it exclusively. I find this is hardly ever true. Just this moment for example, I'm trying to fix my posture, exercise some muscles, drink some fluids, clean off my desk, IM with my brother, and write this essay. Over the course the day, I've worked on this essay, read a book, had some food, answered some email, chatted with friends, done some shopping, worked on a couple other essays, backed up my hard drive, and organized my book list. In the past week I've written worked on several different software projects, read several different books, studied a couple different programming languages, moved some of my stuff, and so on.

Having a lot of different projects gives you work for different qualities of time. Plus, you'll have other things to work on if you get stuck or bored (and that can give your mind time to unstick yourself).

It also makes you more creative. Creativity comes from applying things you learn in other fields to the field you work in. If you have a bunch of different projects going in different fields, then you have many more ideas you can apply.

Make a list

Coming up with a bunch of different things to work on shouldn't be hard -- most people have tons of stuff they want to get done. But if you try to keep it all in your head it quickly gets overwhelming. The psychic pressure of having to remember all of it can make you crazy. The solution is again simple: write it down.

Once you have a list of all the things you want to do, you can organize it by kind. For example, my list is programming, writing, thinking, errands, reading, listening, and watching (in that order).

Most major projects involve a bunch of these different tasks. Writing this, for example, involves reading about other procrastination systems, thinking up new sections of the article, cleaning up sentences, emailing people with questions, and so on, all in addition to the actual work of writing the text. Each task can go under the appropriate section, so that you can do it when you have the right kind of time.

Integrate the list with your life

Once you have this list, the problem becomes remembering to look at it. And the best way to remember to look at it is to make looking at it what you would do anyway. For example, I keep a stack of books on my desk, with the ones I'm currently reading on top. When I need a book to read, I just grab the top one off the stack.

I do the same thing with TV/movies. Whenever I hear about a movie I should watch, I put it in a special folder on my computer. Now whenever I feel like watching TV, I just open up that folder.

I've also thought about some more intrusive ways of doing this. For example, a web page that pops up with a list of articles in my "to read" folder whenever I try to check some weblogs. Or maybe even a window that pops up with work suggestions occasionally for me to see when I'm goofing off.

Make your time higher quality

Making the best use of the time you have can only get you so far. The much more important problem is making more higher quality time for yourself. Most people's time is eaten up by things like school and work. Obviously if you attend one of these, you should stop. But what else can you do?

Ease physical constraints

Carry pen and paper

Pretty much everyone interesting I know has some sort of pocket notebook they carry at all times. Pen and paper is immediately useful in all kinds of circumstances -- if you need to write something down for somebody, take notes on something, scratch down an idea, and so on. I've even written whole articles in the subway.[^sub]

(I used to do this, but now I just carry my computerphone everywhere. It doesn't let me give people information physically, but it makes up for it by giving me something to read all the time (email) and pushing my notes straight into my email inbox, where I'm forced to deal with them right away.)

Avoid being interrupted

For tasks that require serious focus, you should avoid getting interrupted. One simple way is to go somewhere interrupters can't find you. Another is to set up an agreement with the people around you: "don't bother me when the door is closed" or "IM me if I have headphones on" (and then you can ignore the IMs until you're free).

You don't want to overdo it. Sometimes if you're really wasting time you should be distracted. It's a much better use of time to help someone else with their problem than it is to sit and read the news. That's why setting up specific agreements is a good idea: you can be interrupted when you're not really focusing.

Ease mental constraints

Eat, sleep, exercise

Time when you're hungry or tired or twitchy is low-quality time. Improving it is simple: eat, sleep, and exercise. Yet I somehow manage to screw up even this. I don't like going to get food, so I'll often work right through being hungry and end up so tired out that I can't bring myself to go get food.[^t]

It's tempting to say to yourself, "I know I'm tired but I can't take a nap -- I have work to do". In fact, you'll be much more productive if you do take that nap, since you'll improve the quality of the day's remaining time and you were going to have to sleep sometime anyway.

I don't really exercise much so I'm probably not the best person to give advice on that bit, but I do try to work it in where I can. While I'm lying down reading, I do situps. And when I need to go somewhere on foot, I run.

Talk to cheerful people

Easing mental constraints is much harder. One thing that helps is having friends who are cheerful. For example, I always find myself much more inclined to work after talking to Paul Graham or Dan Connolly -- they just radiate energy. It's tempting to think that you need to get away from people and shut yourself off in your room to do any real work, but this can be so demoralizing that it's actually less efficient.

Share the load

Even if your friends aren't cheerful, just working on a hard problem with someone else makes it much easier. For one thing, the mental weight gets spread across both people. For another, having someone else there forces you to work instead of getting distracted.

Procrastination and the mental force field

But all of this is sort of dodging the issue. The real productivity problem people have is procrastination. It's something of a dirty little secret, but everyone procrastinates -- severely. It's not just you. But that doesn't mean you shouldn't try to stop it.

What is procrastination? To the outside observer, it looks like you're just doing something "fun" (like playing a game or reading the news) instead of doing your actual work. (This usually causes the outside observer to think you're lazy and bad.) But the real question is: what's going on inside your head?

I've spent a bunch of time trying to explore this and the best way I can describe it is that your brain puts up a sort of mental force field around a task. Ever play with two magnets? If you orient the magnets properly and try to push them towards each other, they'll repel fiercely. As you move them around, you can sort of feel out the edges of the magnetic field. And as you try to bring the magnets together, the field will push you back or off in another direction.

The mental block seems to work in the same way. It's not particularly solid or visible, but you can sort of feel it around the edges. And the more you try to go towards it the more it pushes you away. And so, not surprisingly, you end up going in another direction.[^s]

And just as you can't get two repelling magnets to sit together just by pushing real hard -- they'll fling back as soon as you stop pushing -- I've never been able to overcome this mental force field through sheer willpower. Instead, you have to be sneaky about it -- you have to rotate a magnet.

So what causes the mental force field? There appear to be two major factors: whether the task is hard and whether it's assigned.

Hard problems
Break it down

The first kind of hard problem is the problem that's too big. Say you want to build a recipe organizing program. Nobody can really just sit down and build a recipe organizer. That's a goal, not a task. A task is a specific concrete step you can take towards your goal. A good first task might be something like "draw a mockup of the screen that displays a recipe". Now that's something you can do.[^nc]

And when you do that, the next steps become clearer. You have to decide what a recipe consists of, what kind of search features are needed, how to structure the recipe database, and so on. You build up a momentum, each task leading to the next. And as your brain gets crunching on the subject, it becomes easier to solve that subject's problems.

For each of my big projects, I think of all the tasks I can do next for them and add them to my categorized todo list (see above). And when I stop working on something, I add its next possible tasks to the todo list.

Simplify it

Another kind of hard problem is the one that's too complicated or audacious. Writing a book seems daunting, so start by doing an essay. If an essay is too much, start by writing a paragraph summary. The important thing is to have something done right away.

Once you have something, you can judge it more accurately and understand the problem better. It's also much easier to improve something that already exists than to work at a blank page. If your paragraph goes well, then maybe it can grow into an essay and then into a book, little by little, a perfectly reasonable piece of writing all the way through..

Think about it

Often the key to solving a hard problem will be getting some piece of inspiration. If you don't know much about the field, you should obviously start by researching it -- see how other people did things, get a sense of the terrain. Sit and try and understand the field fully. Do some smaller problems to see if you have a handle on it.

Assigned problems

Assigned problems are problems you're told to work on. Numerous psychology experiments have found that when you try to "incentivize" people to do something, they're less likely to do it and do a worse job. External incentives, like rewards and punishments, kills what psychologists call your "intrinsic motivation" -- your natural interest in the problem. (This is one of the most thoroughly replicated findings of social psychology -- over 70 studies have found that rewards undermine interest in the task.)[^kohn] People's heads seem to have a deep avoidance of being told what to do.[^avo]

The weird thing is that this phenomenon isn't just limited to other people -- it even happens when you try to tell yourself what to do! If you say to yourself, "I should really work on X, that's the most important thing to do right now" then all of the sudden X becomes the toughest thing in the world to make yourself work on. But as soon as Y becomes the most important thing, the exact same X becomes much easier.

Create a false assignment

This presents a rather obvious solution: if you want to work on X, tell yourself to do Y. Unfortunately, it's sort of difficult to trick yourself intentionally, because you know you're doing it.[^feyn] So you've got to be sneaky about it.

One way is to get someone else to assign something to you. The most famous instance of this is grad students who are required to write a dissertation, a monumentally difficult task that they need to do to graduate. And so, to avoid doing this, grad students end up doing all sorts of other hard stuff.

The task has to both seem important (you have to do this to graduate!) and big (hundreds of pages of your best work!) but not actually be so important that putting it off is going to be a disaster.

Don't assign problems to yourself

It's very tempting to say "alright, I need to put all this aside, hunker down and finish this essay". Even worse is to try to bribe yourself into doing something, like saying "alright, if I just finish this essay then I'll go and eat some candy". But the absolute worst of all is to get someone else to try to force you to do something.

All of these are very tempting -- I've done them all myself -- but they're completely counterproductive. In all three cases, you've basically assigned yourself a task. Now your brain is going to do everything it can to escape it.

Make things fun

Hard work isn't supposed to be pleasant, we're told. But in fact it's probably the most enjoyable thing I do. Not only does a tough problem completely absorb you while you're trying to solve it, but afterwards you feel wonderful having accomplished something so serious.

So the secret to getting yourself to do something is not to convince yourself you have to do it, but to convince yourself that it's fun. And if it isn't, then you need to make it fun.

I first got serious about this when I had to write essays for college. Writing essays isn't a particularly hard task, but it sure is assigned. Who would voluntarily write a couple pages connecting the observations of two random books? So I started making the essays into my own little jokes. For one, I decided to write each paragraph in its own little style, trying my best to imitate various forms of speech. (This had the added benefit of padding things out.)[^ex]

Another way to make things more fun is to solve the meta-problem. Instead of building a web application, try building a web application framework with this as the example app. Not only will the task be more enjoyable, but the result will probably be more useful.

Conclusion

There are a lot of myths about productivity -- that time is fungible, that focusing is good, that bribing yourself is effective, that hard work is unpleasant, that procrastinating is unnatural -- but they all have a common theme: a conception of real work as something that goes against your natural inclinations.

And for most people, in most jobs, this may be the case. There's no reason you should be inclined to write boring essays or file pointless memos. And if society is going to force you to do so anyway, then you need to learn to shut out the voices in your head telling you to stop.

But if you're trying to do something worthwhile and creative, then shutting down your brain is entirely the wrong way to go. The real secret to productivity is the reverse: to listen to your body. To eat when you're hungry, to sleep when you're tired, to take a break when you're bored, to work on projects that seem fun and interesting.

It seems all too simple. It doesn't involve any fancy acronyms or self-determination or personal testimonials from successful businessmen. It almost seems like common sense. But society's conception of work has pushed us in the opposite direction. If we want to be more productive, all we need to do is turn around.

Thursday, January 4, 2007

When a child goes to Kindergarten

Give him lots of blocks of different colours
Give him lots of blocks of different shapes
Give him musical toys and musical books

The Greatest of All - "Knoweledge"

Gnaritas is Latin for “Knowledge”
And Maximus meaning “Greatest.”


The main idea behind this blog is to jot down everything that is important for success

"Woeful Wails" - My Dad's account of what happened in 1989 at Srinagar, Kashmir

A Shiver, a shudder goes down my spine To have lost what once was mine The merciless devils who strode the streets With guns pointing at u...