Wednesday, November 30, 2016

A look at various healthcare alternatives

American healthcare is of good quality, but it is expensive and not available to many people. Individuals pay (with premiums, copay and deductions) and governments pay (with tax money or deficit) and 17% of GDP is on healthcare and at least half of that is overhead. Here is the summary of five healthcare alternatives.

It is completely philosophical and ethical stand where you stand on healthcare. Some believe in free market to bring quality, progress in medicine and service innovation. Some believe healthcare is right and every one deserves and government needs to provide it.

Before Obama:

  • 15% of the population is people with over age 65 and they get insurance with Medicare. 15% of them are poor and disabled and they get insurance from Medicaid program. Payments for these polices are funded by taxes on income and payroll.
  • 60% of the population have employer sponsored or group insurance. 10% of population buy insurance themselves in individual market.
  • After considering overlap of some having both medicare/medicaid and private/employ insurance, 85% of the people have some insurance. Many of these people are under insured as insurance companies can have limits and caps on payments.
  • Overall 15% of the people have no insurance either because they are poor, they do not want it or they are denied by insurance companies. They do not go to hospitals unless they are really sick. If they can not pay, the system absorbs by raising costs and taxes on every one.
  • Insurance companies may also charge women more, sick more, not cover existing diseases, put more premiums, deductibles and copays for trading with quality, or different rules for different hospitals depending on which state they operate.


Tries to bring more people under insurance without replacing private insurance plans. It brought new 9% of the population under insurance.

  • Insurance offerings should not deny based on health, gender or age and should cover all preexisting conditions. They should not have caps on total payment.
  • Improve coverage by extending medicaid up to 138% of the poverty line, allowing people to stay on parents' plan till age 25, forcing all companies with 50 people to sponsor insurance or pay additional tax, providing exchanges/government run websites where insurance companies compete for individual buyers, providing subsides on those websites who are below 400% of poverty line. Subsides and medicaid grants are funded from more taxes on rich and federal deficit.
  • Reducing costs - Keeping people healthy by forcing insurance companies to not charge copay for preventive care, incentives to keep elderly people healthy, paying for health care based on output per person instead of per treatment or per test or per visit in medicare, regulating insurance companies to not have more than 20% overhead on healthcare or send rebate back to clients.
  • All of the above fairness and coverage ideas cause loses or reduce profits for insurance companies. Solution is to mandate every one including young and healthy to have insurance or pay small tax.

Why it became infamous despite having so many good things?

  • Some are philosophically against mandate and think it is against freedom.
  • Supreme court allowed states to reject extensions to medicaid and twenty states rejected.
  • It is gradual roll out and some are phased out.
  • Insurance premiums increased because more payments need to be done and insurance companies are mainly business oriented and tried to extract more or retain profits.


It tried to extend Obamacare more.

  • Reduce out of pocket expenses by allowing three doctors visits without copay, limiting max responsibility of individual to 250$ for medicines per year, tax credit 2500$ per year for out of pocket expense is more than 5% of income
  • Increasing competition by offering public insurance in addition to allowing private insurance companies in exchange. Payment is from federal deficit and indirectly from federal taxes.

It tries to replace Obamacare with single payer or government insurance. Payment is from additional 2% income tax and capital gains tax and additional 6% payroll tax and the rest is from federal deficit.


Though it is claimed as repealing Obamacare, it may end up like some additions and some removals.

  • Keep preexisting conditions coverage and young adults coverage under parents.
  • Reducing premiums by giving more medicaid grants to states, removing regulations for cross state business for insurance companies. Funding for grants is minor federal deficit.
  • Reducing taxes by allowing premiums as tax deductions.
  • Remove the individual mandate as it is disliked philosophy for some people.
  • Possibly removing many regulations Obamacare got and give freedom to insurance companies again on policies and offerings. This may cause increase in out of pocket expenses for some clients.

Wednesday, August 17, 2016


Repechage is practice of giving more opportunities to players who are capable but lost early because of unlucky draw in single elimination game tournaments.  It addresses the situation where the top players meet in a blood round, also known as early elimination round or knockout round. Such unlucky draw will matter less in round robin game tournaments. The word is derived from french word repecher that means

In martial arts tournaments of Judo, Karate and wrestling, single elimination events will determine the top two players. All the losers to a topper in the first, second, third and quarter final elimination rounds in a group will enter repechage. The first round loser will compete with second round loser to decide the one who will compete with next round loser and so on. The two winners from each group will be given the third position. Indian wrestler Sakshi Malik won the medal in repechage round.

Other games have different methods like limiting only to quarter final losers instead of to all rounds. Some games extend it to even semifinalists and not just finalists and a semifinal loser will play with winner from other group to avoid repeated play with same semifinalist.


Friday, July 8, 2016

Putnam Competition

Putnam competition is annual math test across the schools in United States. It is organized on the first Saturday in December in two three hour sittings with a lunch break in between.

The test consists of 12 questions that requires basic college mathematics and creative thinking. One can only participate at most four times. The top five scorers are named Putnam Fellows.

William Lowell Putnam Competition at wikipedia
Additional information about Putnam competition
Archive of putnam problems and solutions
Good collection of putnam problems and solutions cataloged by year
Putnam and beyond problem book and study guide

Wednesday, June 22, 2016

Ceva's theorem

Simple yet powerful theorem that gives the properties of concurrent lines from vertices in a triangle is Ceva's theorem. If the lines AD, BE and CF are concurrent, then  AF/FB x BD/CD x CE/EA = 1. This is attributed to Italina mathematician Giovanni Ceva.

The lines that start from vertices to opposite edges are called cevians. Some examples are medians, angle bisectors, altitudes. Theorem can be used to easily determine whether three such lines are concurrent. Intersection points of such lines are significant centers of triangle in geometry. Some example centers of triangle are centroid, incenter, circumcenter and orthocenter.

* Ceva's theorem
* Ceva's theorem
* Triangle Centers

Tuesday, June 21, 2016

Burnside Lemma

Group theory is formal study for analyzing systems and processes that have symmetry and structure. When an operation is performed on some element, it preserves some structure. Many surprising patterns and discoveries can be made about such symmetries and structures.

Groups are applicable in fields like polynomial equations, polymer structures, topology, number theory, probability, quantum physics and combinatorics. Cauchy, Galois, Cayley, Frobenius, Polya, de Brujin, Redfield and and other several mathematicians contributed to field, but Burnside collected all research and publicized it in his book Theory of groups of finite order in addition to his own contributions to the field.

Group is mathematical abstraction that consists of a set of elements and an operation that satisfies certain properties on the given set. Set of integers with addition form a group. The theory will be more beautiful in dealing with sets of finite order and their symmetry. Set of rotations of rubic cube with combining operation form a group. Symmetry group or permutation group is group whose set is set of transformations like rotation, reflection and moving of an object and whose operation is composition of transformations.

Burnside lemma is a result in group theory that says the number of orbits of input set operated under a group of transformations is equal to the average number of points fixed by the transformations of that symmetry group. It is used to count distinct possible objects or configurations considering the symmetry of objects.

Each possible configuration is an input point. Orbit of a point is set of all possible points possible by applying a transformation of group. Orbits are subset of all points. All elements of orbit share the orbit. Orbits do not overlap and they partition the set of input configurations. Fixed points of a transformation are unchanged points after applying it. Many points may be identical and are simply few transformation away from other points and are so become one orbit. The number of orbits are the number of distinct possible objects or configurations.

Example: Counting the number of bracelets with total four beads of two colors. Two bracelets are considered same if they look identical after some rotation or flipping. There are eight symmetries.
  • No movement will keep all sixteen bracelets intact.
  • Two bracelets do not change after rotation by one bead.
  • Four of them do not change to original after rotation by two beads.
  • Two of them do not change to original after rotation by three beads.
  • Four of them do not change after horizontal flip.
  • Four of them do not change after vertical flip.
  • Eight of them do not change after clockwise diagonal shift.
  • Eight of them do not change after anticlockwise diagonal shift.
  • Total fixed bracelets is  48, that is 16 + 2 + 4 + 2 + 4 + 4 + 8 + 8.
  • Total distinct number of bracelets is 48/8 or six.

Sunday, June 12, 2016


Six sigma is set of techniques and tools to maintain quality of manufacturing or serving processes in industry. It was developed at Motorolla but was later adopted by General Electric and other companies.

The Six Sigma follows two processes.
  • DMAIC for existing processes - define, measure, analyze, improve and control
  • DMADV for new process - define, measure, analyze, design and verify.
Sigma is statistical term that measures how far something deviates from average. Six sigma process means a process that has no more than 3.4 defects per million oppurtunities. The idea behind six sigma is that you can measure how many defects in your process and figure out how to eliminate them.


Friday, June 10, 2016


One of the great geniuses ever lived is Leonhard Euler. He contributed to number theory, topology, calculus, infinite series and many branches of the mathematics in 18th century. He started his education in Basel and worked in St. Petersburg and Berlin for most of his life.

Some of the discoveries by Euler
  • e^ix = cos(x) + i sin(x) and e^i(pi) + 1 = 0
  • v - e + f = 2 to describe relation between verities, edges and faces of polyhydra. 
  • Euler line on which orthocenter, circumcenter and centroid are collinear for any triangle.
  • Euler totient function to count the numbers that are relatively prime to a number
  • Summation of series like ∑ (1/n2) , ∑ (1/n!), ...

Sunday, June 5, 2016

Problem solving

Problem solving strategies - Arthur Engel
Mathematical Problem Solving - Alan-Schoenfeld
Thinking Mathematically - J. Mason, L. Burton and K. Stacey
How to Solve it - G. Polya, John H. Conway
The Art and Craft of Problem Solving - Paul Zeitz

Wednesday, April 20, 2016

Topping the tulips

Tulips grown in natural habitat go through a life cycle to look like perennial plants. They need cold winters and hot airy dry summers.

Life of tulips start from the bulbs we plant. They bloom using energy from bulbs, they create new bulbs using remaining energy and bulb will die as it is all used up,  Planting is done in early fall. Root expanding happens in winter. Sprout starts in spring. Blooming takes place in hot summer. Disintegration starts from that time and new bulbs will be formed. They start growing by accumulating more energy from environment. The period from blooming to plant dyeing is called as grand period of growth.

Growers in Holland and Seattle dig their tulips every year and give temperature treatment to their bulbs manually and replicate what they receive in their natural region. Growers from regions with year around cold weather give temperature treatment to new bulbs. Growers from regions with year around hot weather give cooling treatment to bulbs.

Tulip growers top the tulips when they bloom fully. They do that for three reasons.
  • They do not want petals of flowers falling into foilage and cause plants to rot and die before new bulbs had chance to grow.
  • They want to use all energy for new bulbs to grow and avoid new seedpod consuming energy and create small late blooms.

Monday, March 21, 2016


In the words of one of the founders of Unix,  the best thing about unix is it's community and not the tools, files, c language, portability or open source, and the worst thing about unix is that there are many communities.

Good, Bad and Ugly about Unix

Friday, March 18, 2016

telecine 2:3 pulldown

Films are shot and projected at 24 frames per second. NTSC based televisions and monitors display 60 pictures per second. The technique to convert from film fps to telivision fps is called telecine process.

First each input frame is divided into two fields, odd and even scan lines. This is called interlacing. It reduces the bandwidth to transmit by half.

Next it follows a field duplication method called 3:2 pull down. Since 60/24 = 2.5 = 5/2, we need to create five pictures out of every two frames. It repeats the first field two times and second field three times and so on for the odd and even number pictures.

If the input is already interlaced for broadcasting and we want to display on computer monitor, we need to deinterlace at the least to properly display it. It is not simple summing the fields into one picture and need some averaging of some pixels from adjacent fields. Pictures are not static and they are half pictures of two consecutive pictures of motion. If it is telecined, then deinterlacing is more than the averaging the adjacent pictures and involves finding the right pictures to average.

The term pulldown is actually about slow down. It was mandatory to have color television broadcasting to allow old black and white televisions to continue to work. They continued to transfer luminescence or lightness or brightness information along with chrominance or color information. They were also concerned about additional bandwidth required to transmit color information to black and white telivsions. They slowed down the frames per second by transmitting only 1000 frames during the interval 1001 frames were transmitted earlier.

Wikipedia page 3:2 pulldown process
Apple tutorial telecine process
Miscrosoft doc temporal rate conversion
Framerate follies trick

Saturday, March 12, 2016

Gamma coding

Humans are more sensitive to relative differences between darker tones compared to relative differences between lighter ones.  This is some kind of power law. 

If we simply linearly encode the image for all hues, we need to allocate too many bits to store it and also cause too much bandwidth to transmit it.  Assuming humans can respond to luminescence values 100 to 1 and can detect the contrast ratio of two values that exceed 1% or 1.01 delta, we need to encode values 1, 1.01, 1.02, .... 99.09, 100 and the total number of codes needed is 99/0.01 or 9900 codes or 14 bits for each tone. We also end up using few bits to shadow values that humans are sensitive to and that will be lost opportunity to improve the quality. We use more bits to portions that humans are not sensitive to and that will be additional cost with no improvement to visual quality. So linear encoding is not good from both the compression and quality point of view.

If we use the observation that most highlights cannot be differentiated by humans, we can employ nonlinear encoding.  If we encode only ratios starting from 1,  1 + 0.01, (1+0.01)^2, ... , then we need just  log(100)/log(1.01) or around 462 codes or nine bits. If a television or display has only contrast ratio of 50:1, then it is just eight bits.

Power law :  Vout = Vinγ

Gamma(γ) is slope of log plot of input and output. Most of our images are encoded with 0.45 gamma value and decoded with 1/0.45 or 2.2  gamma value.  There is another power law in place in CRT based display monitors. The light produced on the display is approximately proportional to the applied voltage raised to the 2.5 power. This is also called gamma. This is amazing coincidence that vision gamma or image gamma is kind of inverse to display or monitor gamma. The net effect of applying both gammas is called system gamma and ideally should be 1.0. 


Gamma correction
Gamma FAQ
System gamma

Thursday, March 3, 2016

Mirrors and images

Characteristics of the image formed when an object is placed before a plane mirror.

  • Image size is same as the size of the object. Magnification factor is one.
  • Distance of image from mirror is same as the distance of object from mirror.
  • Image is upright and not inverted.
  • Image appears left and right reversed.
  • Image is virtual. It appears like it is formed in the back of the mirror where the light can not even reach.
Single mirror produces one image. When an object is placed between two mirrors, there will be more than one image. When the mirrors are placed together to form a right angle, then the number of images formed is three - one in each mirror and one in the crease. When the mirrors are placed with 60 degrees, then the number of images formed is five.  When the angle is theeta, the number of images will be (360/theeta -1). 

The more accurate formula depends on the angle and the position of the object.  This was from a paper by V.M. Kulkarni in 1960.

  • When 180/theeta is integer x, then the answer is 2*x - 1,
  • When 180/theeta is integer x + 0.5, then the answer is 2*x when the object is on angular bisector or symmetrically located with respect to two mirrors or 2*x + 1 otherwise.
  • When 180/theeta is integer x + (n/q), then the answer is 2*x or 2*x +1 depending on whether the object is located on central angular sector of (q-2*n) about the angle bisector.
  • When 180/theeta is ineger x + (n/q), then the answer is 2*x or 2*x +1 depending on whether the object is located on central angular bisector of (2*n-1) about the angle bisector.

Light from Physics Classroom
Patterns in Multiple Reflections

Monday, February 29, 2016


Smörgåsbord is used to refer to a buffet table with variety of dishes.

It was originally a type of Scandinavian meal originating in Sweden. It is served with multiple hot and cold dishes on the table.  

The meaning of Smorgasbord is open faced sandwich table. Smor is butter. Gas is goose but referred to butter floated to surface of the cheese. Bord means table.

Sandwich is two slices of bread with some food filling between them. Open faced sandwich is a single slice of bread with food items like cheese spreads, butter, meat slices, sausages and vegetables on top of it.

A special Swedish smorgasbord is Julbord or Christmas table. Jul means Christmas and bord means table.


Sunday, February 28, 2016

Grand Slam Tennis

Grand slam tournaments are four major annual tennis tournaments that offer most ranking points, prize money and popularity.
  • Australian Open in January on hard court in Melbourne started in 1905
  • French Open in May or June on clay court in Paris started in 1891.
  • Wimbledon in June or July on grass court in London started in 1877.
  • US Open in August or September on hard court in New York since 1881
Winning all four tournaments in same year winning grand slam. Don Budge in 1938 is the first official champion. Rod Laver won it two times in men's singles in 1962 and 1969. Margaret court won once in women's singles and twice in women's mixed doubles. Esther vergeer won twice in women's wheelchair doubles. Stefen Edburg won in men's juniors. Three women, Martin Connolly Banker in 1952, Margaret Court in 1970 and Steffi Graph in 1988 won all grand slam titles in single year.

Winning four grand slam tournaments in any year is called career grand slam. Six men including Fred Perry, Don Budge, Rod Laver, Roy Emerson, Andre Agassi, Roger Federer and Rafael Nadal are career grand slam winners. Ten women, Martin Connolly Banker, Doris Hart, Shirley Fry Irvin, Margaret Court, BillyJean King, Chirst Evert, Martina Navratilova, Serana Williams and Maria Sharapova won career grand slam in women's titles.

Winning Olympics gold medal along with four tournaments in same year is called golden grand slam. Winning four grand slam tournaments and an  Olympics gold medal is called  career grand slam. Andre Agasse is the first male player to win it.

Dong Budge won six consecutive singles grand slam titles. Roger Federer won 17 grand slam men's singles titles. Pete Sampras and Rafael Nadal won 14 grand slam men's single titles. Rafael Nadal won 9  French Open singles titles and that is the highest in a men's single tournament. Pete Sampras and Roger Federer won seven Wimbledon singles titles.

Margaret Court won 24 grand slam women's singles titles. Steffi Graph won 22 grand slam women's singles titles and is the only winner of golden grand slam in 1988. Serena Williams won 21 gran slam women's singles titles. Hellen Wills Moody won 19 grand slam women's single titles Chris Evert and Martin Navratilova won 18 women's singles titles. Margret Court won 11 Australian Open single titles. Chirst Evert won 7 French Open singles titles. Martina Navratilova won 8 Wimbledon titles. Molla Mallory won 8 U.S. open titles.


Benford's law

Benford's law, also referred as first digit law, is a principle that in any large random real-life sets of numerical data, around 30% numbers begin with 1, around 18 percent begin wit 2, and so on, very small data begins with leading digit 9.  It is a frequency distribution law of nature.

Simon Newcomb, american astronomer, noticed in 1881 that first few pages of logarithm books are used more.  Frank Benford, physicist, paid attention to it in 1938. He collected data from 20 different domains like surface areas of rivers, sizes of populations, physical constants and numbers from a reader's digest magazine.

Wikipedia Benford's law
Wolfram Mathworld page

Wednesday, February 24, 2016

Mendicant Order

Mendicants are people who take vow of poverty, disown all personal property, exclusively relies on charity from others to survive and spend all their energy on preaching and practicing the religion.

Mendicants mean beggars. Some Hindu ascetics, Sufi saints, Buddhist bhikkus, Jain monks and Christian friars live as mendicants.  In catholic church, Franciscans, Dominicans, Carmelites, Servites and Augustinians are mendicant orders.

Mendicant orders

Tuesday, February 23, 2016

Occam's razor

Occam's razor is a guiding principle to verify a hypothesis, to propose a theory, to solve a problem or to deduce logical conclusions. Other things being equal, simpler explanations are better than the complex ones.  More things should not be used than are necessary. It is a law of briefness that says that it is not worth it to do with more what is done with less.

Ockham was a town in England. William of Ockham was an early 15th century English theologian and philosopher. Jis original words are "plurality must never be posited without necessity". Razor was referred to shaving away unneeded assumptions to prove a hypothesis. It is a tool to encourage parsimony in argument or simplicity in logic. It says that simplest explanation is usually the right one.

It is used in many number of fields in science, medicine, logic, mathematics, philosophy, theology and law. It can also be used in context of simple things and observations in every day life. It helps in reasoning to slice through the problem or situation. If you find a fallen tree, most possible claim to verify first is that some wind would have blown it down rather than some meteorite hit it which requires several other rare things to happen.

Wikipedia Occam's razor
HowStuffWorks Occam's razor

Monday, February 22, 2016

Labrador dogs

Labrador Retrievers are the most popular dogs in the USA for the last twenty five years. Labrador dogs are hunter friends and fetch game. They are family dogs and good-natured. Other popular dogs in order are German Shepherd, Golden Retriever. Bulldogs, Beagles, French Bulldogs, Yorkshire Terriers, Poodles, Rottweilers, Boxers, Pointers and Siberian Huskies.

The French Bulldog continue to jump spots over the decade and is currently in sixth rank.

Popular dogs

Thursday, February 18, 2016

Elements of Style

Read the following two sentences and the second part of each of them looks like an afterthought or twist on the first part of it.  The compound sentences formed with conjunctions like "and" and "but" are sometimes vague in explaining the relationship. Such style of writing trigger the minds of the reader to recall something said earlier and form some relationship between the two parts.

"The early records of the city have disappeared, and the story of its first years can no longer be found."

"The situation is perilous, but there is still one chance of escape."


The relationship between the two parts of the compound sentence can be made more clearer with better words like "as" or "although". This style helps the reader to keep his mind calm and relaxed.

"As the early records of the city have disappeared, the story of its first years can no longer be found."

"Although the situation is perilous, there is still one chance of escape."


Using subordinate clauses and a complex statement is even better than any compound statement in terms of words it required or time it takes to parse it. The disadvantage of such compaction gives impression that it is too formally written.

"Owing to disappearance of the early records of the city, the story of its first years can no longer be found."

"In this perilous situation, there is still one chance of escape."


Elements of Style

Monday, February 15, 2016

Second Ammendment

Second amendment gives the right to  people to own and carry Arms. This right may not be violated by the State because a well equipped militia is necessary for keeping state safe and secure. It was passed by congress on September 25th and added to constitution on December 15th in 1791. It is one of the ten amendments to the Constitution contained in the the bill of rights.

The actual text reads: "A well regulated Militia, being necessary to the security of the free State,  the right of the people to keep and bear Arms, shall not  be infringed."

The debate is mostly around whether the right is individual or collective right. Supreme court invalidated a federal law that bans Arms in Washington D.C.

History of the second ammendment
Second amendment interpretations
Constitution Center on 2nd Ammendment

Wednesday, February 10, 2016

Rule of Seventy Two

"Rule of 72"  is an approximate formula to find how much time it takes for an investment to double with compound interest.  It can also be used in other things that grow similar to interest.

Some scenarios are below. 

  • If you invest 100$ with annual percentage of 6%, it takes approximately 72/6 or twelve years to double the original investment. 
  • If you invest 100% with annual percentage of 9%, it takes approximately 72/9 or eight years to double the investment value. 
  • If the inflation year over year is 4%, the money will lose half of the current value in eighteen years.
  • If bacteria grows 3% every hour, it will double in size in twenty four hours or a day.
  • As the population of India is growing at 1.2% from 1B people, the population if India will become 2B people in 72/1.2 or sixty years from now.
  • If the trend of the GDP growing at 6% annually continues, it will become twice the current GDP in 72/6 or twelve years.
  • Suppose an exponential program on n inputs runs for 10 seconds and the increasing input by one takes 11.2 seconds or 12% over 10 seconds, then increasing the number of inputs by six more inputs requires 20 seconds to run the program.

Seventy two is chosen so that it has several divisors and can be convenient for computation. Choosing sixty nine or seventy improves accuracy.  The formula is correct between 6% and 10%, The accuracy for every 3% away from 8% can be improved by adding additional 1 to the value of 72. If you invest 100$ with annual percentage of 25%, it takes 75.66/25 or little more than three years to double the investment value.

Verification from the basic mathematics

S = Sum, P = principal, R = interest rate percentage, r = interest rate fraction = R/100.
The sum after one periodic interval: S = P  + PR/100 =  P(1 + R/100).
The sum after two periodic intervals:  S = P(1+r)(1+r).
The sum after n periodic intervals:  S  = P(1+r)^N

When S = two times the value of P,   2   =  (1+r)^N
Number of periods can be calculated by taking logarithm on both sides.

log(1 + r) = r for small values between 5 to 10%.
N = log(2)/log(1 + r)  = 0.6933/r = 69.33/R

Wikipedia - Rule of 72
Investopedia - Rule of 72
Exponential double time  - Rule of 72
Better Explained - Rule of 72

Tuesday, February 9, 2016

Fire = Heat + Fuel + Oxygen

Fire requires three things - fuel, heat and oxygen (oxidizing agent). A fire can be stopped by removing at least one of them from the context of the fair. Combustion is chemical reaction that feeds more heat to fire and continues it.

Without fuel, the fire can not start or continue. Reducing the heat stops the combustion. Adding water reduces heat in the fire, as water absorbs some energy to convert to vapor. Depriving the oxygen near the fuel controls the fire. Water should not be used for all fires. When there is oil or combustive metals or electricity is near the fire, adding water creates more problems. Covering with blankets, halogen or carbon diode are attempts to reduce the oxygen. Some materials like nitroglycerin acts as both - the fuel and the oxidizing agent.

There is fourth element required for fire to continue. That is chain reaction or continuing the chemical equation. Inert agents like dry sand breaks the chain reaction.

Class A Fires involve wood, paper and fabric. Removing any element extinguishes the fire. 
Class B Fires involve flammable liquids. Inhibiting the chain reaction with halogens suppresses the fire. 
Class C Fires involve flammable gases. Inhibiting the chain reaction suppresses the fire. Class D Fires involve flammable metals. Specialist skills are required to contain the fire. 
Class E Fires involves electrical equipment. Ordinary combustibles control the fire.
Class F Fires cooking oils and fat. They can be suppressed by removing oxygen or water mist.

Fire classes
Fire Triangle

Monday, February 8, 2016

Tamil first lesson

வ ண க்க ம்!
Va na k ka m - Namasthe!

எ ம், பே ர், பிர ச ன் னா.
E n, Pe r, Pra sa n na
My name is Prasanna

ஒ ங் க, பே ர், எ ன் ன?
U n ga, Pe r, E n na?
What is your name?

நா ன், கூ கு ல் இ ல், வே லை, செ ய் கி றே ன்.
Na n, Goo go le e, l, Ve lai, Se y ki re n.
I am working at Google.

நீ ங் க ள், எ ங் கு, வே லை செ ய் கி றீர் க ள்?
Nee n ga n, E n ga, Ve lai Se ya ki re k n?
Where are you working?

எ ன், தா ய் மொ ழி, தெ லு கு
E n, Ta y Mo li, Te lu gu
My mother tongue is Telugu.

உங் க, தா ய் மொ ழி, எ ன் ன?
Un ga, Ta y Mo li, E n na?
What is your mother tongue?

ந ன் றி
Na n ri

அ ற ம் செ ய வி ரு ம் பு
A ra m, Se ya, Vi ru m bu
Just, do, like - Do the right thing!

Tamil wikitionary

Sunday, February 7, 2016

Simply the best

George F. Haines is one of the great sports coach, who founded santa clara swim club in 1951, stayed there for twenty four ytears, and sent 53 swimmers to olympics and won 68 olympic medals during his tenure there. He was also physical education teacher at Santa Clara high school in those 24 years. He was the head coach of United States Olympics team, He later coached at UCLA and Stanford.

He was inducted into international swimming hall of the fame. He is major force behind the careers of several athletic people like Don Schollander, Donna de Varona, Chris von Saltza, Steve Clark, Claudia Kolb and Mark Spitz.

George Haines
Santa clara swimming club
The championship swimming

Friday, February 5, 2016


Panipat is located in Haryana and about 90 km north of Delhi and 169 km south of Chandigarh on NH1. It is currently known for recycling old wool clothes and producing shoddy yarn.

There have been three battles of Panipat.

1526: Mughal empire founder Babur vs. Delhi Sultanate Ibrahim Lodi
1556: Mughal emperor Akbar vs. Delhi King Hemu or Hemachandra 
1761: Durrani king Ahmad Sha Abdhali vs. Maratha commander in chief Sadasiva Bhau


Wednesday, February 3, 2016

Ken Burns Effect

When there is only still imagery but video footage is not available, panning and zooming the photos to give moving video effect is called Ken Burns Effect. Ken Burnes is an american documentary film maker and tv producer. He produced several films like civil war, the baseball, Jazz, National Parks, Mark Twain, The Roosvelts, The prohibition and Thomas Jefferson.

Ken Burns Effect

Tuesday, February 2, 2016

PSU companies

Public Sector Undertaking(PSU) companies where the central or state governments have more control than other private entities. They are classified as three kinds.

  • CPSE(Central Public Sector Enterprises)
  • PSB(Public Sector Banks)
  • SLPE(State level public enterprise)
There are around 280 central public sector companies in India. Ministry of Heavy Industries and Public Enterprises control around 50 or majority of public sector enterprises. (CCI) Cement Corporation Of India) or BHEL(Bharat Heavy Electoricals Limited) are some examples. Other ministries own the rest of them. Air India Limited is administered by civil aviation ministry. Coal India Limited is administered by coal ministry. Steel Authority of India Limited is controlled by steel ministry. Many PSEs are listed on stock exchange like other private companies are.

They are divided into several kinds based on their performance. Maharatnas, navratnas and miniratnas.  Navratnas are companies that have competitive advantage and potential to become global players. Nav in Navratnas means not nine but new. They can invest up to 1000 crores without taking government permission. Miniratnas are also profit making companies or have potential to profit making but are not ready to perform at global level. Miniratnas are again divided into two subcategories. The high rank ones make 30 crores profit at least in one of the three past years and can make investment up to 500 crores without taking government permission. The miniratnas second category can make up to 300 crores investment without taking government permission.

Maharatnas are large Navratnas that have real power to excel in domestic and global market and government can give more autonomy for them to expand. They have annual profit of 2500 crores. They have around 25000 crores turnover and net worth of 10,000 crores. They can make investment up to 5000 crores without taking government permission. Currently seven companies, BHEL, SAIL, Coal India Ltd, GAIL(Gas authority of India Limited), IOCL(India Oil Corporation Limited), ONGC(Oil and Natural Gas Corporation Limited) and NTPC (National Thermal Power Plant) qualify for this category. Their performance will be reviewed annually by inter ministry committee to make decision on whether to continue the status.


Saturday, January 30, 2016


Unicorn is legendary and mythical animal with single pointed horn. It was depicted as a creature in arts and crafts of all civilizations.

Uniforns or narwhals are startup companies whose evaluation exceeds one billion dollars. Unicorns are supposed to be rare animals, however there are around two hundred. Top unicorns are uber, xioami, airbnb, palantir and snapchat. Uber is worth sixty two billion dollars now. Decacorns are companies whose evaluation exceeds ten billion dollars and they include dropbox and pinterest.


Thursday, January 28, 2016

Next to Pearls

Reading further to Programming Pearls

  1. Software Requirements and Specifications by Michael Jackson
  2. Conceptual Blockbusting by James L Adams
  3. How to solve it by Polya
  4. Code Complete by Steve McConnell
  5. Rapid Development by Steve McConnell
  6. Project Survival Guide by Steven McConnell
  7. Science of Programming by David Gries
  8. Practice of Programming by Kernigan and Pike
  9. Medical Detectives by Berton Rourche
  10. Hints for Computer System Design by Butler Lampson
  11. How to Lie with Statistics by Darrel Huff
  12. Innumeracy : Mathematical illiteracy and it's consequences by John Allen Paulo
  13. Data Structures and Algoritms by Aho Hopcroft Ullman
  14. Introduction to Algorithms by Corman, Leiserson, Rivest
  15. Mythical Man Month by Fred Brooks
  16. The Art of Computer Programming by Donald Knuth
  17. Algorithms by Robert Sedgewick
  18. Mathematical theory of communication by Claude Shannon
  19. Literate Programming by Donald Knuth

Sunday, January 24, 2016

Ballot problem

In an election where a candidate gets p votes and other candidate gets q votes and p > q, the probability that the first candidate maintains the lead throughout the counting procedure is (p-q)/(p+q).

It was first published by W.A. Whitworth in 1878 and later rediscovered by Joseph Louis Francois Bertrand in 1887.

Bertrand's ballot theorm
Ballot problem solution

Friday, January 22, 2016

P/E ratio

P/E ratio means price of a stock of company divided by earnings per share (EPS).  It is the amount of money share holders want to pay for earning one dollar money. A good P/E ratio is between 15 to 25. Comparing P/E ratios of companies in same field is meaningful. S/W or technology companies may have higher P/E whereas old stable industries may have lower P/E value.

If it is more, it may mean either market is optimistic and thinks there is risk or there is no growth for the company or it may mean overvalued than it is worth. If it is less, then market is pessimistic about the the company or it may mean it is undervalued than it is worth in reality.

Price = Earnings * P/E ratio.
Stock price increases either because the real earnings increased or because the market perception caused the multiple (P/E) to increase.

If a company acquires other company with higher P/E, then it prefers cash purchase. If a company acquires other company with lower P/E, then it prefers to do stock purchase.

investopedia P/E
wikipedia P/E

Wednesday, January 20, 2016

PIN codes

PIN code stand for Postal Index Number code. It was introduced on independence day in 1972. It is six digits long. The first digit represents a zone and it is typically one or more states. There is one functional zone for army and military purpose. The first three digits together represent a geographical region or sorting facility at a main post office. Fourth digit represents the delivery route and zero digit means it is in main area of the post office. Fifth and sixth digits represent the delivery post office.

PIN codes start from North most states around Delhi and head south along the west coast in increasing order and then they head north along the east coast after reaching the south and head west and end in central India.
  • 1 - Delhi, Haryana, Punjab, Himachal Pradesh, Jammu and Kashmir, Chandigarh
  • 2 - Uttar Pradesh, Uttarakhand
  • 3 - Rajasthan, Gujarat, Daman and Diu, Dadra and Nagar Haveli
  • 4 - Goa, Maharashtra, Madhya Pradesh, Chhattisgar
  • 5 - Andhra Pradesh, Karnataka, Telangana
  • 6 - Tamil Nadu, Kerala, Puducherry, Lakshadweep
  • 7 - Odisha, West Bengal, Arunachal Pradesh, Nagaland, Manipur, Mizoram, Tripura,Meghalaya, Andaman and Nicobar Islands, Assam, Sikkim
  • 8 - Bihar, Jharkhand
  • 9 - Army Post office (APO) and Field Post office (FPO)

wikipedia PIN codes

Monday, January 18, 2016

zip codes

ZIP stands for zone improvement plan. There are 41,716 codes in United States of America.

Robert A. Moon, a postal employee, noted that rail based and address based delivery systems would not scale and fought for twenty years for number based systems what was to become the ZIP code with three digits. He divided the country into 900 regions.  H. Bently Hahn added fourth and fifth digits and persuaded the panel to go with five digits and credited with new system that revolutionized the postal delivery. It is further extended to nine digits or zip+four system in 1983.

Before zip codes were invented, workers sorted mail in some special mail cars in trains. United states post office (USPS) lost lot of trained personal during wars. Volume of mail was increasing rapidly - 43 million mails every week or 30 billion mails annually. Planes started carrying more mail than trains did.

The numerical system made easy transition to mechanized processing from manual sorting. However it took long time for people to start writing zip code along with mail address. United states post office (USPS) came up with cartoon character Mr. ZIP and campaigned that including zip code makes mailman travel with high speed. Mr. ZIP character was originally designed by Howard Wilcox of Cunnigham and Walsh Ad Agency for use by a Newyork bank to use in banking by mailing campaign. AT&T purchased the design and gave to USPS without the cost.

Some ZIP codes are unique to single high volume address like 20500 for white house and 72716 for Walmart headquarters. They are 2122 such codes. Some ZIP codes are for military, diplomat offices and embassies. There are 532 such codes. Some ZIP codes are used for solely post box addresses in some cities. There are 5122 such codes. Rest of the ZIP codes are based on geographical location. They are 29773 such codes.  Wealthiest zip code is 90210 for Beverly Hills, CA.

First digit denotes a state or group of states. The digit 9 is shared by west coast states California, Oregon and Washington, Alaska, Hawai and several other islands. Second and third digits denote a region or large city in those states. Together the first three digits denote sectional facility center or the main sorting and distribution center for an area. Fourth and Fifth digits denote group of addresses within a region. ZIP codes can cross state and other political boundaries. ZIP codes start on east coast and increase southwards and continue heading towards northward and westward east of Mississippi river, southward west of Mississippi river and northward on west coast.

ZIP codes are also used for gathering statistics like cenus data, marketing campaigns to identify purchase patterns, income patterns and demographics and as key in several online database systems.

ZIP code
Robert Moon
H. Bently Hahn
wikipedia Mr. ZIP
Zip code statistics

Tuesday, January 12, 2016

Abraham Lincoln

Abraham Lincoln is one of the greatest american presidents. He led the nation through the civil war and kept the union with all possible ways he can - with diplomacy, with war and with power.

He changed parties but he campaigned and fought for abolition of slavery all the time; Whigs 1834-1854, Republican 1854-1864 and National Union 1864-1865.

He is still remembered for the following two milestone events.
  • Emancipation Proclamation in 1863, an executive order by president to change the federal legal status of slaves in southern states to free.
  • Thirteenth amendment that completed abolishing slavery in all states except as punishment for a crime. Senate passed april 18th, 1864 and house passed it after one unsuccessful vote on jan 31st, 1865.
Similar ammendments were attempted by Arthur Livermore in 1818 and John Quincy Adams in 1839.

Abraham Lincoln
Thirteenth Ammendment

Sunday, January 10, 2016

Fisher's Principle of gender ratio

Ronald Fisher in his 1930 book "The genetical theory of natural selection" explains why the male to female ratio in most species is 1:1. It is one of the most celebrated principles in evolutionary biology. It may be wrongly attributed to him and scientists before him may knew it. He popularized it with his book and attracted the attention of wider community. 

If a community or group of animals has a tendency to produce offspring of one sex, natural selection prefers the representative parents who have that tendency in the community when the population of that sex is less compared to that of other sex or it prefers different kind of parents otherwise. Once the ratio is achieved, it can swing to other side again and the process repeats.

Fisher is a British scientist and biologist. Works of him along with British geneticist JBS Haldene and American geneticist Sewell Wright is considered to be founded the discipline of population genetics. He did several other contributions to biology like fisherian runway that explains why male peacocks and other animals have natural decorations.

Population Genetics
Fisher's principle
Ronald Fisher

Saturday, January 9, 2016

Mount Rushmore

Mount Rushmore is a national memorial located in blackhills in Keystone, South Dakota, US. It has pictures of four presidents, George Washington, Thomas Jefferson, Theodore Roosevelt and Abraham Lincoln, sculpted into a granite rock hill. 

It was done by danish american Gutzon Borglum and his son, Lincoln Borglum. The carving starred in 1927 and completed in 1941. It was done with the support from president Calvin Cooledge and senator Peter Norbeck. 

See Mount Rushmore wikipedia link

Thursday, January 7, 2016

Great circle distance

Earth is sphere and more accurately a spheroid. Calculating distance between two points on earth is different to calculating the distance between the two points on flat surface. The Circle that connects the two points with center of the sphere as the center is called great circle. The distance between the points is the length of the arc between the points on great circle.

Approximate method:
Circumference of earth at equator is 40,076km and we have 360 degrees in circle and so each degree of longitude at equator is about to 111.32km or 69 miles. The distance between two longitude lines decrease from the equator to poles.

Around 30 degrees north or south from the equator, one degree of longitude is about 96.41km. Around 45 degrees north or south of equator, one degree of longitude is 78.71km. Around 60 degrees, one degree of longitude is 55.66km. Around 75 degrees north or south of equator, one degree of longitude is 28.82km. Around 90 degrees from the equator, that will be poles and one degree of longitude is zero distance.  

However the distance between two lines of latitude stay almost same anywhere from equator to poles. Small difference is because of the shape of the earth. One degree of latitude is 110.57km at equator and 111.69km at poles.

Once we have longitudinal distance and latitude distance between two points, we can compute the distance between two points. The Pythagoras theorem can be used here.

Using cosine law:
Suppose the geographical latitude and longitude of two points on the earth are a1, a2 and b1. We can compute the central angle between them is given by the spherical law of cosines
c = arccos(sin(a1).sin(a2) + cos(a1).cos(a2).cos(|b2-b1|))
The distance d, or the arc length on a sphere of radius r formed by spherical angle c in radians  = r. c; 

Using haversine law:
Alternatively if we know the linear distance between the points as w and using sine law, length of arc on great circle can be calculated as 2*r*arcsin(w/(2.r)).

Lat Lang Story
Great circle distance using cosine law
Great circle distance using sine law
Longititude and latitude measuring

Wednesday, January 6, 2016

California King

Twin or single - 39 inches x 75 inches = 99 cm x 191 cm = 3' 3'' x 6' 3''
Twin XL - 39 inches x 80 inches = 99 cm x 203 cm = 3' 3'' x 6' 8''
Three quarters - 48 inches x 75 inches = 122 cm x 191 cm = 4' x 6' 3''
Full or Double - 54 inches x 75 inches  = 137 cm x 191 cm = 4' 6'' x 6' 3''

US Queen or UK king - 60 inches x 80 inches = 152 cm x 203 cm = 5' x 6' 8''
US King or UK Superking - two twin xl - 76 inches x 80 inches = 193 cm x 203 cm = 6' 4'' x 6' 8''
Cal King - 72 inches x 84 inches = 183 cm x 213 cm = 6 foot x 7 foot

Mattress dimensions
* Bed size
* Bed sizes

Monday, January 4, 2016

Ethernet MTU limits TCP MSS

TCP Maximum segment size (MSS) or payload in TCP packet is typically 1460 bytes only!

Length of IP packet is capped by 16 bytes field in IP header which itself is 20 bytes and so MTU for protocols on top of IP is = 2^16 - 20 = 65515 bytes and it is much larger than 1460 bytes.

TCP implementations want to use lowest mss that can avoid the packet fragmentation over the internet.

Maximum transfer unit (MTU) is the size of the largest payload a packet can contain after subtracting the header and other metadata information needed to transmit the payload.

Ethernet frame size is 1530 bytes, but ethernet MTU is only 1500 bytes. Payload is preceded by ethernet header and is followed by Frame check Sequence(FCS).
* preamble 7 bytes, start frame 1 byte
* header 14 to 18 bytes - source addr, dst addr, optional 802.1 vlan tag and payload type.
* FCS - 4 bytes.

Subtracting 20 bytes for IP header and 20 bytes for TCP header, 1500 - 40 = 1460 bytes.

* Ethernet frame