Planning your future family using Pascal’s triangle

Recently I came across a problem similar to this,

What if you you are planning for your future family of 3 girls and 3 boys, how difficult it is or is it 50/50 chance?

Need few minutes to think of it? Go for it…

Amidst different methods of solving this problem I decided to use Pascal’s triangle. This is trivial but it was fun, therefore I decided to note it.

The above events distribute along a binomial distribution. Theoretically it satisfies four conditions:

  1. There are n trials
  2. Outcome of each trial is binary (two values, Girl or Boy)
  3. Through out the trials, probability of having a girl or boy is constant.
  4. The trials are independent to each others.

To calculate the coefficients we use Pascal’s triangle. As you all know the rows of the Pascal’s triangle relates to binomial expansion. Check the below Pascal’s triangle.

First 7 rows of Pascal’s Triangle

For example: elements of the 3rd row relates to the coefficient of the binomial expansion of (x + y)^3 = (x^3 + 3x^2y+ 3xy^2 + y^3) or in general nth row of the triangle relates to (x + y)^n.

Lets take having a boy is denoted by x and having a girl is denoted by y. In that case (x + y)^6 would give all the possibilities. However we are interested of having 3 girls and 3 boys. In order to solve that we can take the 6th row of the triangle which is;

1    6    15    20    15    6    1

It can be denoted as follow too:

1.x^6 + 6.x^5.y + 15.x^4.y^2 + 20.x^3.y^3 + 15.x^2.y^4 + 6.x.y^5  + 1.y^6

The coefficient of having 3 boys and 3 girls is 20 (20.x^3.y^3)

How about the total number of events with different combinations? Since there are two outcomes and 6 trials, it should be simply 2^6 = 64 in other words the sum of all the coefficients of (x + y)^6 , again it is equal to the sum of numbers in the 6th row.

So the probability of having 3 boys and 3 girls in your future family is

20/64 = 31.25%

Image Credit : user:gunther (
This article is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported (CC BY-SA 3.0) license. 

Overcoming the conventional stumbling block to global success

I do hope you will enjoy the following article as much as I did. May it be a motivation …

Dr. Sanjiva will be delivering “The IESL Ray Wijewardene Memorial Lecture – Nobody to Leader : Achieving Global Leadership with Software”, today (2017 Sep 7) at IESL. More Info…

a 22-year-old, ftesh out of university, can solve problrms but they haven’t seen many problems yet. You learn problems as yoh go along. The key to being a good entrepreneur is not about identifing problems but about caring enough to solve it.

Copyright Notice : This article appeared in DailyFT paper, 2017 Sep 6. and I hold no copyrights. Shared with an intention to educate others. All rights reserved by the above named publication.

Google abandoning “Google Code”

It is Googles’ fashion to shutdown services which are not popular enough. The latest victim was Google Code project [1] which was started in 2006. Google was very frank on the press release I suppose. I would like to quote the following.

When we started the Google Code project hosting service in 2006, the world of project hosting was limited. We were worried about reliability and stagnation, so we took action by giving the open source community another option to choose from. Since then, we’ve seen a wide variety of better project hosting services such as GitHub and Bitbucket bloom. Many projects moved away from Google Code to those other systems.

It is true that GitHub gained increase popularity among developers for code hosting and many developers are comfortable with it too. However as Google claimed it was true that in 2006 the choices were limited, even GitHub started in 2008 [1]. However the large picture is quite astonishing. In 2006, Google was a giant company and Google Code was one of the projects they have started. They could have done something better than GitHub, I believe.

However it is good to see the dynamics of Google, other than few, most of their interests never seems fixed. It quite sounds like the open source way too.

I worked closely with Google Code repositories few years back and it is quite sad to hear that it is getting shutdown. But I think it is the right decision they took. Need to move forward with new interests and causes.

Good Bye, Google Code for the support hosting open source projects through the decade of service.




Inevitable destiny of Sri Lanka with South Africa in quarter finals ?

In ICC world cup 2015, most matches in Pool A and B are already come to an end. Most of the teams are waiting for their final match while Sri Lanka completed all 6 matches in first round and got qualified for quarter finals.

Photo credits :
Photo credits :

Though Sri Lanka played in Pool A, there is a quite interest towards Pool B, because of the quarter final opponents will be decided by their standings. Sri Lanka would end up being at the third place with the collapse for Australia. Therefore there should be a keen interest on the Pool B 2nd place, whatever the team securing the 2nd place will play against Sri Lanka in quarter final match.

In Pool B, India undoubtedly secured the first place and they will be playing against Bangladesh.

The next match, South Africa is playing against UAE and will secure 8 points.

West Indies is playing against UAE and will secure 6 points.

The only doubt comes on who wins the match, Pakistan vs Ireland. The winning team will secure 8 points and would be competing for the 2nd and 3rd places (net run rate decides the winner) and the loosing team has to compete for the 4th place with West Indies again. It sounds quite interesting, isn’t it?

However since South Africa and West Indies are playing against UAE there is a high possibility of gaining of their net run rate compared to Pakistan and Ireland. If it is assumed that Pakistan blow out Ireland, then based on the net run rate South Africa will be 2nd, Pakistan will be 3rd and 4th place will be securing by the West Indies.

It seems like, most of the time Sri Lanka will be played against South Africa on 18th March, the first Quarter final match. Wish Sri Lanka good luck !!

Birth Control – Introduction

Recently I participated for a pre-marriage counselling program and physical relationship after marriage was discussed as a topic of the program. However there was no enough time to cover the everything and as a result I started reading on the topic, focusing on the birth control techniques. Then I decided to share my findings with my readers hoping it would be helpful.

Birth controlling has started since many couples are not eager to except what god gives them as it is. The main idea behind is to avoid unexpected pregnancy.

However to achieve that goal there are two methods available, one is natural birth control and the other is artificial  methods.

“Effectivenessofcontraceptives” by Center for Disease Control and Prevention. Licensed under Public Domain via Wikimedia Commons

Pills, condoms, surgeries fall under artificial methods. Other than wearing condoms, the other artificial methods are having side effects more or less and may be directly cause for infertility. Therefore it is good to keep those methods away as much as possible.

However it is good to know some theory behind.

Ovary, in female reproductive system releases eggs at a rate of nearly once a month (menstrual cycle). A female has two  ovarys where eggs releases alternately. Then the egg is traveled through the Fallopian tube to womb. The approximated travel time is 1-2 days through the Fallopian tube from the time the egg is released. For a successful pregnancy, a sperm should meet the egg while the egg is in the Fallopian tube. If such happened then the reproductive system generates hormones that signal the brain and command to ready for a pregnancy. The brain adopt the changes and stops releasing eggs since the message has been already delivered about the pregnancy.

When using pills the above natural process is simulated with the help of chemicals. Therefore with no eggs the chance of getting pregnant get low. However there is no easy and fast recovery when taking pills is terminated. That is why those pills can be lead to permanent infertility or disorders.

Following video explains well about release of the egg

While the pills changes the hormone structure, surgeries block eggs and sperm contacting each other. Like blocking the Fallopian tube and etc. Condoms and other wearing protections do the same but they do not interfere internally or chemically.

Therefore when artificial methods are concerned, there are two folds. What is the safest and side effect free method. There is a scale for it. Known as Pearl Index [1].

While my preference is always lies with wearing condoms as the one and only artificial birth control method you can refer to the “Comparison of birth control methods”[2] and get to know more.

** Please bear mind that I am not a medical practitioner and this is no any medical advice, please refer to family planning consultant for more reliable information.




Bangladesh in ICC 2015

Bangladesh has been qualified for the quarter final match of the ICC 2015 world cup. It was remarkable but was not a surprise. Bangladesh is in Pool A, and there was a high possibility that they could be securing 5th place over Afghanistan and Scotland {if Bangladesh win those 2 matches it gives 4 points where other two countries could win maximum 1 match (unless something very extraordinary happens) which gives 2 points only}. However today, the Bangladesh team stands at the 4th place with 7 points.

The next match versus New Zealand would be most probably in favor of New Zealand and at last Bangladesh would remain in the 4th place and advances to quarter final match with India. Unless nothing extraordinary happens, Bangladesh would be terminating 2015 world cup career after the match with India. However it should be noted that their achievement is quite remarkable through out the past few years.

Further Bangladesh was awarded 1 point due to the match with Australia got cancelled due to rain. That point however made no difference even England blew out the Bangladesh team.

Wishing all the best for Bangladesh at their quarter finals and in the next match with New Zealand. It is so good that all Asian teams advanced to quarter finals in the world cup.



Pre-Cana seminar – Report

There are few criterion, a roman catholic couple should complete before they stand in front of the altar for exchange of their marriage vows. One of them is obtaining the certificate by completing the pre-cana seminar. According to wikipedia pre-cana is described as “Pre-Cana is a course or consultation couples must undergo before they can be married in a Catholic church. The name is derived from John 2:1–12, the wedding feast at Cana in Galilee, where Jesus performed the miracle of turning water into wine.”[1]

As mentioned the intention was to consult couples before they get married and educate them regarding the aspects of the marriage life.

Recently my fiance and myself got the chance to attend such seminar to earn the eligibility. It was held in one of the centers in Colombo Diocese[2] on Sunday. The seminar was a one day program, 0830 to 1730 hrs.

The process of attending to such seminar is quite easy. A letter from the priest of the grooms’ church would be required and then the priest of the brides’ church would issue the form (or vice-verse) that is mandatory to attend the seminar. That form should be filled with care since only one form is being issued and try to make it accurate as much as possible since the certificate would carry those information. All instructions are on the form itself and it is required to register before hand.  We were asked to present at the place before 30 minutes. A valid identification document (NIC, Passport or Driving License) was required to register at the venue.

0830 hrs the registration was started and then followed by a introductory address by one of the volunteer.

The first section was about the views of the marriage based on the perspectives of the Holy Bible. It was discussed along with five points extracting some phrases from the Holy Bible.  The five points are

  1. Integrity and sustainability of the marriage
  2. Equal respect
  3. Marriage bond based on love
  4. Sexual side of the marriage life
  5. Divorce

The first session lasted around 2 hours where the voluntary couple (Upali and Nelishiya, a married couple for 35 years) shared their experience along with the perspectives of the Holy Bible covering above mentioned five points.

After the tea break the second section has begun by another voluntary couple (married for 16 years and having 5 sons and daughters, remarkably quite surprising). The main topic of the discussion was the physiological aspects of the marriage.  It was a good sessions where again 5 stages of the marriage was explained with examples and sharing of their experiences. It was an interesting discussion where the participants were interacted with the presenters. Fice stages discussed are;

  1. Romantic stage
  2. Disappointment and Disillusionment stage
  3. Differentiation and Acceptance stage
  4. Modulation and integration stage
  5. Mature love stage

Once the second session was concluded the seminar was paused for the lunch.

After the lunch break the third section was started which was about the physical relationship between the couple after marriage. Another voluntary couple directed the session.  How sex relates with the beliefs of the Catholic church was discussed first and then followed by the topics on issues faced by new couples in their sex lives, natural birth control techniques and abortions. It was good info specially they discussed a lot more technical aspects on natural birth control techniques (The Catholic church refuses artificial birth control techniques including condoms to LRT and etc..).

The last section was started right after the evening tea break. This session was organized in small groups (consisting 8 members in each group) where the voluntary couples separately addressed the small groups (male partner of the couple addressed the males and female partner addressed the girls in separate locations). Groups were formed separating males and females, it was regarding the social aspects of the marriage life. It covers how to cope with the new parents and siblings after the marriage and how to manage the financial requirements.

There were two questions per session (different questions) to be answered from what has been learnt and it was collected at the end of the seminar. Before concluding the event, two attendees addressed the participants and shared their views on the program. Certificates were distributed at the end of the seminar to all the participants.

Frankly I believe the program filled a gap and strengthened the knowledge that is really necessary for couples who are starting their lives as husband and wife. A humble thank with respect should be extend to all the volunteer couples (specially their dedication and commitment to make the program success and important), the priest in-charge of this program at the center and all the stakeholders.

May the blessing of the Jesus always with them and strengthen them to delivery much more to direct the lives of new couples into the right direction.