Hypothesis Testing with Controlled Experiments: Computing P-value using Z-statistic

Fake Professor

Google the word “experiment”, the answer returned is, “a scientific procedure undertaken to make a discovery, test a hypothesis, or demonstrate a known fact”

While “Experiment” is a broader term, a controlled experiment specifically is about testing impact of a single factor /variable while the other variables remain constant.

Confused? Don’t worry, read ahead. I will attempt to explain this using a scenario.

Imagine Saidulu is an ice-cream manufacturer who wants to increase the sales of his product “Kya toh bhi Ice-cream”.  His friend, Panthulu, suggests him to double the sugar content in ice-cream in order to achieve higher sales.

Will Saidulu go ahead and increase sugar in his ice-cream? That’s a bad business move. Fortunately Saidulu is smart, he conducts a controlled experiment. Voila!

How does he do that?

First, Saidulu tries to understand his customer segments. He narrows down attributes of his major consumer segment on the parameters…

View original post 1,227 more words


To stock or not to stock that inventory – how much to buy?


Retail Managers are responsible to ensure stock availability to customers by replenishing stocks regularly. At the same time, they are also responsible for profitability of their category or division, leading to questions on – whether we should carry that product and how much inventory should we carry on hand? This is where it gets interesting. Because if you want to cater to all customer demand, then theoretically you must carry infinite inventory so that you cater to all customers who may or may not come. And, carrying infinite inventory is a loss-making proposition, leading to unhealthy inventory and write-offs. Let us understand this through an example below.

Let’s say the product you are going to sell costs $6 and you will sell it at $10, making a profit of $4. However, if you cannot sell that product then you will incur a loss of $6 (product cost).

Therefore, the tradeoff here is between:

a). the profit that you’d earn if the customer walks in and you have it in your inventory

b). the loss that you’d incur if you stock and the customer doesn’t turn up

To make the right decision of whether to hold that extra unit of inventory or not, you need to understand the probability of selling that inventory (say one unit) denoted as Px.

  • If the probability of selling that extra unit is 100% (P100), then you should surely stock it and make a profit of $4.
  • If the probability of selling that extra unit is 25% (P25), then the payoff is

25%*$4 + 75%*(-$6) = -$3.5 (negative payoff). Since this is going to make a negative payoff, you shouldn’t stock that unit of inventory.

  • If the probability of selling that extra unit is 80%(P80), then the payoff is

80%*$4 + 20%*(-$6) = $2 (positive payoff)

  • If the probability of selling that extra unit is 60%(P60), then the payoff is

60%*$4 + 40%*(-$6) = $0 (critical point). So, as long as the probability of selling that extra unit is 40% or above, you should keep stocking inventory. Most auto-buying systems are designed in this way to stock inventory until the probability of selling that unit of inventory goes below the critical point.

Also, the probability of selling that unit is within what time period? It is within the planning cycle (order cycle time plus lead time from PO to delivery). Your days on hand should always be as lean as possible and close to the planning cycle. Credit period is the maximum limit of the planning cycle, but ideally shorter the planning cycle the better the benefit is for the business

The one mistake that we did in the above calculation is we wrongly assumed that profit that we will make out of the sale is only from that particular unit. We should also include the profit that we could’ve made by that particular customer in all future purchases at our store – customer lifetime value (CLV). So, the tradeoff has to be between the customer lifetime value of the customer vs. the loss you’d incur if the customer doesn’t turn up at all. Also, the above calculation should take ‘time’ into account in the form of cost of capital (inventory holding costs) because many times the loss is not the entire cost of the product.

In conclusion, the value of having that inventory in stock changes basis a lot of parameters such as CLV, importance of that category or brand to the image of the retail store, brand equity of the store, type of store and many other business parameters.

The one question that we are yet to answer is: how do we determine the probability of sale?

Intuitively you know that the probability of selling that first unit of a TV is 100%, the 100th unit is say 80%, 500th unit is 40% and 1000th unit is 10%. Probability changes by quantity.

To get the probability you should simulate a demand distribution basis past historical sales data. Demand in retail scenarios are usually normal distributions. So, we will need the average and standard deviation. It is what we learnt in our MBAs – you will calculate the probability for the random variable (sellout of a TV model) to take the value 500 units and that is P (X=500). One of the ways is for you to calculate the Z value =  (500 – average)/SD and then lookup for that Z value in the Z table to get the probability. This is if the distribution is gaussian or normal distribution. There are other ways too to get this estimate basis various distribution fits such as chi-square, t distribution (for small sample size of 30-100), gamma distribution, beta distribution, pareto distribution and others. Each of these distributions has a method to calculate the probability like the way we have for normal distribution as mentioned above. Typically, in the pre-computer era, because it was so difficult to calculate the area under the curve manually statisticians used to categorize the data they have into one of the 20-30 templatized distributions and use one of the methods to calculate the probability. In the computing era of today, we can actually plot the data and calculate the actual area under the curve with the help of a computer quickly. Therefore, if you don’t know which distribution the plot is looking like it is better to just calculate the area under the curve manually and get the probability. This method is called the ’empirical method’ or ’empirical distribution’. So, if you don’t know which distribution is your data looking like, you can opt for empirical probabilities.

Thank you.

A primer on the picture and sound technology behind your television

No matter what your preference is in terms of brand or size, picture quality and sound quality are the two most important parameters for a good TV viewing experience. In this post, we will get an understanding on how to evaluate picture quality and sound quality of your TV.

Understanding Picture Quality

The quality of a picture is primarily determined by resolution, contrast ratio, refresh rate, picture engine, panel type and color depth (and viewing angle for some).

Resolution – how much data (number of pixels) is carried or shown in one frame, the greater the resolution the larger the data and hence a clearer picture. At an ideal viewing distance for a particular screen size, one shouldn’t be able to see individual pixels in a TV with a good resolution. It is important to check for pixel resolution especially around corners and edged objects on the screen.


Screen resolutions.png



Contrast ratio – the ratio of the brightest whites to darkest blacks. As shown below, the right side picture has a poor contrast.

Contrast ratio picture 1.png

A good contrast ratio will produce a bright image without lightening up the darks as shown below

Contrast ratio picture 2.png

Refresh rate Long back, somebody has discovered that if you run 24 pictures or frames per second (fps) then humans will perceive the act as a motion or a video. Therefore, refresh rate is how fast is the frame refreshed physically – it is the number of frames per second the TV can display – the higher it is, the more smoother and natural looking the motion of the video. Typically, you see 60 Hz (that’s 60 frames per second) and 120 Hz. Anything more is not required and not accurately described. These days all brands claim higher refresh rates by super-imposing frames or introducing blacks between two frames. These are artificial ways to improve refresh rates, but the native refresh rate is what one has to depend on while purchasing a TV. Check for blurs and noise around curves and edges before buying. While 120 Hz is a definite advantage over 60 Hz, most data sources are not beyond 60 Hz and hence 60 Hz is good enough. The advantage of 120 Hz comes in being able to play a 24 fps video smoothly.

Picture Engine – A picture engine is an image processing system that takes individual signals from various video output sources and throws an output onto the screen. Video processors typically include buffers, sequencers, colorizers, mixers and other linear and non-linear acts. They use various parallel computing technologies to enhance image and video production on digital devices such as TVs and Cameras. Since each manufacturer has its own ways of enhancing picture, there is no clear quantifiable way to rank a picture engine. Sony’s X-Reality picture engine is considered to be a state of the art picture engine. Similarly, there are top quality picture engines in other major brands such as Apple and Samsung. A recommendation to TV buyers is to watch out for the image processor and the picture engine in your TV before the purchase and check its performance online.

Panel Type – There are three major technologies used behind panel technology: ADS/TN (twisted nematic), VA (vertical alignment) and IPS (in-plane switching).

TN panels don’t provide great viewing experience, but however they provide high refresh rates (120 Hz) and high pixel response times required for gaming.

VA panels are the most common panels in LEDs and are often considered as a middle child between TN and IPS. VA panels have better viewing angles and dark blacks, however they sacrifice the response time (8 millisec) when compared with TN.

IPS panels have the best color reproduction, viewing angles and response time (4 millisec). While the earlier IPS technologies were slow in responsiveness and refresh rates, there has been significant improvement in recent IPS technologies with refresh rates of 120 Hz and 144 Hz.

VA Panel vs IPS Panel

Color depth – Color depth is the number of colors that a pixel can take. If a pixel is represented by 16 bits, then it will give you 65536 (2^16) colors.

24 Bit Colour: This format stores the Red, Green and Blue value for each pixel. Each of these can be one of 256 values, giving a total of 16,777,216 colours (256x256x256). Using 16 million colours allows for very photorealistic images, but increases the storage space requirements to three Bytes for each pixel.

32 Bit Colour: This format uses the same format as above for the Red, Green and Blue colours but also stores transparency information for each pixel. This allows each pixel to be one of 256 values from fully opaque to fully transparent. Because of the extra transparency information, the storage space for each pixel now requires four Bytes.

Viewing Angle – While may not be a very important attribute for Indian houses, a wide viewing angle complements to the experience. Some brands specially call out the 178 degree viewing angle.

Understanding Sound Quality

The quality of a good sound output is determined by output power, signal to noise ratio and frequency response (sound quality). If your TV box doesn’t describe these in detail, you can check the original manufacturer’s website to check these technical parameters in detail.

Output Power – Output power is the raw energy in your speakers and it is measured in watts. It is described as peak output or RMS. Peak output is the maximum energy output of the speaker for a short duration. Root Means Square (RMS) is the average output power over a long period of time. Usually, televisions in India come with 10W and 20W outputs. Typically, smaller TVs don’t come with decent speakers and therefore some people might want to augment the experience with a TV sound system.

Frequency Response – Humans can hear sounds ranging in frequency from 20Hz to 20K Hz. Below 310 Hz sounds are considered as bass frequencies, 310 Hz to 12 K Hz are mid-range frequencies that include human voice, piano, guitar and other instruments, 12K Hz to 20 K Hz are high frequencies that include high treble notes, high notes of human voice and some string instruments.

As you might’ve guessed, most speakers will give you the entire range. However the important parameter is: how does the speaker behave and how accurately is the sound reproduced at each of these frequencies? This is determined by frequency response. A sample frequency response chart is as below.


It tells you what sound pressure level (decibel level) variations will your speaker have at each of the frequencies. Ideally, you would want a flat line across the range, but this is not possible for any speaker. Therefore, a good parameter to check is smooth transitions across the frequency range without any rugged highs and lows.

If a speaker specification only mentions the frequency range, then it is not helpful. You should always look for a specification such as 20 Hz to 18K Hz with +/- 3 dB. This will let you know that the sound pressure won’t drop beyond 3 dB across the frequency range.

While these specifications are not readily available with retailers, with little research on the internet or brand website you can find the detailed technical specifications for your TV or speaker that you are about to buy.

Hope this is useful, thank you.

Credit Card & Bajaj EMI card penetration in India

By the end of Mar 2016, India had 24.5 million credit cards and 661 million debit cards in operation (not issued).

credit card total number of cards added

debit card total number of cards added

The total number of transactions on credit cards grew by 27% while it rose by 48% for debit cards for the year ending March 2016. In March, total number of transactions through credit cards were 72.22 million while the figure for debit cards was 112.87 million.

The average amount transacted on credit card is 2.5x higher than that of debit card.

average amonunt per transactions

Which banks have the largest credit card base?

HDFC Bank and ICICI Bank lead in the total credit card base.

Credit Card issued status bank wise


Which cities have the highest penetration?

While I don’t have the exact city-wise penetration data, CIBIL research shows that maximum number of credit card applicants came from Mumbai, Delhi and Bangalore. An indicative numbers on city-wise credit card penetration is as below.

  • Coimbatore – 12.5%
  • Jaipur – 12%
  • Chennai – 11.7%
  • Delhi – 11.6%
  • Nagpur – 11%
  • Mumbai – 9%
  • Bangalore – 9%
  • Surat – 8%
  • Ahmedabad – 7.7%
  • Pune – 7.6%
  • Faridabad, Kolkata, Chandigrah – 7.5%
  • Kanpur – 7%
  • Amritsar – 5.4%
  • Ludhiana – 5%

On usage, CIBIL data shows that Delhi, Ahmedabad, Pune and Mumbai have a higher usage of credit cards than Kolkata, Bangalore, Chennai and Hyderabad.

Bajaj Finance EMI card too witnessed a steep rise in its number of EMI cards to a total of 9.8 million cards in India.

Credit card & EMI card penetration has largely been low in India for ages. Certain retail categories such as large appliances and other high value purchases are bought a lot on credit and hence it is imperative for ecommerce and offline retailers to look for other opportunities of offering credit to customers for growth in these categories.

Thank you.

Source: http://www.business-standard.com/article/companies/sharp-rise-in-bajaj-finance-s-emi-card-user-base-in-past-12-months-117092300497_1.html)




Procrastination or Executive Function Fail?

Musings of an Aspie

There’s a spot on my kitchen floor, a little cluster of dried reddish drips. I don’t know what it is. If it’s from 3 days ago, it’s tomato sauce. If it’s been there longer . . .  who knows.

I’ve walked past it dozens of times. I look at it. It annoys me. I wonder how it got there. I wish it would go away. It doesn’t occur to me that I can make that happen.

The greasy smudgey fingerprints on the cabinet that I can only see in exactly the right light? The 8-inch long thread that’s been hanging off the bathroom rug since the last vacuuming? The dryer sheet on the laundry room floor? Same thing.

What is this? Why can I sit here and catalog all of these little annoyances yet I still do nothing about them? It’s not like fixing them would take a huge amount…

View original post 745 more words

Are You Losing Money By Calculating Margins Wrong?

I spent time on Friday helping a client update spreadsheets and Excel reports that used an incorrect formula to calculate the margin on bids for construction jobs. While this particular client was looking for a margin of 25%, he was actually getting one closer to 20%. On a $100,000.00 bid, that can be the difference between profit and disaster.

I see sellers new to retailing make this same mistake over and over again.

The seller wants a “mark up” of 30%

So they take their cost (the wholesale price), multiply that by 30% and add the result to the wholesale cost to find the retail, or selling price.


You can certainly find a retail price that way, but it won’t give you a 30% margin. The confusion stems from

  1. Confusion about calculating percentages
  2. The difference between margins and mark ups


Although it is less important, let’s talk about mark up vs margin first.  Many people use these terms interchangeably to mean the difference between what you pay for goods and what you sell them for – that is, gross profit. However, they are not the same thing. Misunderstanding the nature of mark ups and margins can make it easier to calculate them incorrectly – which cuts deeply into your bottom line.

A margin is, most simply put, the percentage of the selling price that is the profit.

  • If you pay $6.00 for an item and you sell it for $10.00, you made a gross profit of $4.00.
  • $4.00 is 40% of $10.00 – so you have a margin of 40%
  • Notice this important distinction- the 40% margin is 40% of the final selling price, not of the wholesale cost.

A mark up is the percent of the cost you add to the wholesale price to get to the selling price.

  • If you pay the same $6.00 and sell the item with a 40% mark up, you make a gross profit of only $2.40
  • 40% of $6.00 is just $2.40
  • A mark up of x% will yield a smaller profit than a margin of x% because the mark up is a percentage of the lower wholesale cost.


Many people say “mark up” when they mean “margin.” If you are fussy about language, this is annoying but it will not lead to financial disaster. It’s just words.

However, if you’ve confused the two concepts and are calculating your margins by mutliplying the wholesale cost by the margin percentage, you could be headed for trouble.

Just remember – you want to calculate your profit as a percentage of the final value, not as a percentage of the original cost. When a customer hands you $10.00, you need to know how much goes into your pocket and how much goes to your vendor.

Do you need a 40% profit margin to survive? Then you want to keep $4 out of every $10.

Also keep in mind that this is a gross profit margin. It does not take into account overhead, fees, etc. You may put $4 into your pocket, then have to turn around and give $1.00 to the landlord, 75¢ to the tax man, 15¢ to the bank for processing fees, etc.

You might end up keeping only $1.50 (net profit) of the original $4.00 (gross profit). Which is why calculating your margin by incorrectly using the wholesale price can be such a disaster. You can actually lose money with every sale!


Now that you know you want your margin to be a percentage of the final cost, how do you actually figure it out?

Relax – as long as you have a calculator handy, it is easy.

Say you want a 40% margin. We know that 100% less 40% leaves 60%. So your wholesale cost represents 60% of the final value. To find the remaining 40%, divide the wholesale cost by .6

  • If  you want a 90% margin – divide the wholesale cost by .1
  • If  you want a 80% margin – divide the wholesale cost by .2
  • If  you want a 70% margin – divide the wholesale cost by .3
  • If  you want a 60% margin – divide the wholesale cost by .4
  • If  you want a 50% margin – divide the wholesale cost by .5
  • If  you want a 40% margin – divide the wholesale cost by .6
  • If you want a 30% margin – divide the wholesale cost by .7
  • If you want a 20% margin – divide the wholesale cost by .8
  • If  you want a 10% margin – divide the wholesale cost by .9

As long as you follow this formula for calculating retail price, you will get the margin you want.