Author Archives: rjainny

Model for Covid-19 in the US

Using some assumptions driven from recent data and current response rate, I have built a fairly simple model to predict the number of COVID-19 cases that will be seen in the U.S.

The model starts with Seattle which reported its first case around Jan 21st.  It didn’t go into an emergency state till the end of February.

The model assumes an average rate of infection after the average incubation period.  It also assumes a ratio of local infection and infections that travel to other areas. This leads to the model’s idea of clusters.  When an infection travels to another area, it creates a cluster.  In a cluster, once a certain number of cases are detected, the area typically goes into a state of lockdown and emergency.   The result of this should be a quickly declining spread and stopping of creating of additional clusters. The model assumes a more and more aggressive reaction response, based on recent data where some places when into emergency or lockdown mode after just 4 reported cases.

The further modeling of areas that are in actual or virtual lockdown is the difficult part as there is no clear data on how quickly the spread will stop. 

The model shows that currently there are close to 19,000 people in the US that are already infected.  Most of them were infected in the 1st week of March and thus are starting to show symptoms now. Thus over the next week or so, the number or confirmed cases will rise dramatically from the last reported 2500 or so.

The model estimates that the total number of infected cases will rise to somewhere between 22,000-25,000 after which the transmission will slow down significantly and essentially be contained. It is estimated that this will happen around the second week of April.

Below is a graph of the estimate from the model.

Of course, no one knows exactly what will happen. The model was built was a rather simple, but logical, set of assumptions and was driven by observed data so far in the US and other countries, but this data is what I found on the internet, which in itself is a bit flawed.

Intelligent design or infinite monkeys

On reading the first dialogues of Hume, I found myself drawn into the argument of the existence of a supreme designer, especially as I was watching Our Planet  on Netflix in parallel.  But during my travels I thought about it vis a vis evolution and was less convinced. This also came out in the later dialogues with Philo’s skepticism. Thinking about it further, we look at nature and its offering essentially at a point in time.  But nature is continuously moving and changing.   To use analogies like that of a well designed watch is wrong, as the watch is a final product and thus has a defined final design. Anything in nature is just it’s current design at that point of time.  So when we look at something spectacular in nature, we cannot thus conclude it was created by intelligent design, but rather that it is part of a continuous process of design improvement that nature is carrying out that has lasted for an almost infinite amount of time and will continue forever.  Thus, there is no deliberate design, and thus a result of the design. I assume this thought essentially describes what we call evolution.

If we take the beginning of life itself and it just keeps taking billions and billions of different arrangements randomly, for which all it needs is time, the abundance of which nature had, the result will be many variations of life form, some which will survive, some which will not – and this just continues. 

So now I find myself in a position in which I am skeptical of an intelligent designer by looking at nature.  However, could it be that the evolutionary process is the intelligent design or is that just the result of randomness of very large numbers (remember the theory of infinite monkeys with typewriters and infinite time will create Shakespeare’s writings).  I am left completely questioning the intelligent design view.

The last generation

Samuel Scheffler’s article “The Importance of the Afterlife. Seriously.” NYU Law Magazine, 2014, describes a scenario from P.D. James’s novel Children of Men, in which humans are inflicted with irreversible infertility and there is no one under the age 25 on earth.  James says that this would likely produce widespread depression, anxiety and despair making some people seek consolation and some to take pleasure in whatever they can – although it would all have the backdrop of sadness and pain.

However, I believe the impact on humans is conditional on the demographics of the existing population.  If the youngest people alive are still near 25, then theoretically there is still a large population of people that have many years to live.  Given our actions tend to be relatively short term focused, there would be many not drawn into despair and will continue to give importance to their activities and projects.  However, if the youngest population was say over 60, it would definitely be a different scenario and all activity would seem total unimportant and futile and there would be widespread depression as everyone just waits for the demise of the human race.

But do assume that the population is currently like the former. It would change most people’s perspective on their activities, but not necessarily make them stop due to the feeling of lack of importance.  Many of our activities revolve around our children and their children.  Creating homes and wealth to pass on; gaining wisdom and knowledge to transfer to them.  All such activities would become totally futile and lose their importance completely.  But the projects and activities that are for ourselves, for our own personal experience and fulfillment – should not be compromised. It will still be a joy to travel around the world and experience nature, it will still be fulfilling to create art and music. We see these activities as part of our life on this earth. This should apply to those who believe in the after life as well as those who don’t.  If you don’t, then you seek these activities for personal satisfaction while alive. If you believe in the after life, you may believe that the after life if not dependent on our material bodies on this material earth and thus the lack of fertility does not matter and our souls will still continue somewhere, somehow, benefitting from the rich experiences we gained while alive.

But then I think of my mother. A famous poet and writer (who passed away recently). It was extremely important that she left an enduring legacy on this planet with her writings so that generations to come could enjoy it. That was her stamp on humanity which created her personal sense of immortality.  If the scenario above happened in her lifetime, there is no doubt she would lose all importance of the value of her writing and fall into deep despair.

While my former argument is based on the assumption that human individualism will allow most to continue to find value in our activities, Mr. Scheffler believes these assumptions are oversimplified and that removing the assumption of an ongoing humanity, the confidence in our purpose will erode .  But from the latter example of my mother, clearly Mr. Scheffler is correct insofar if a person’s purpose is undeniably dependent on the existence of future generations.


I was in Kentucky visiting friends who took me on a short hike on Berea forest trails. These friends are “bird” people – bird watchers and photographers.  So, on the hike, we would stop often when they heard some bird and they would look up to try and capture a photograph – which I also got into and starting pointing out birds in the canopy of the trees. When I saw them my description limited to “…a small black one there..” or “…a large black one over here…”.  They would look at it and say something like, “…that’s a yellow rumped warbler…” and then my friend would take some pictures with the huge lens attached to his camera.

These are what my “little black birds” really looked like!

They live on a 13 acre farm in rural Kentucky, with a view of a pond and lots of trees and vegetation. When I walked down their stairs to their living room I see five cats looking up at me (they are also “cat” people); in the morning the back yard is full of birds looking for food; in the evening the raccoons come around to their porch and eat all the cat food.

My friend, a close buddy from college, got his first SLR a few years ago and now has become a really good bird photographer.  Just around where he lives, and mostly from his porch itself, he has photographed and identified over 130 different bird species.  Some of these are just magnificent, a few pictures below.

The fact that over 130 species in that area of KY alone was mind boggling – well it turns out there are over 10,000 bird species in the world. Add to that all the different mammals, sea creatures, reptiles and the 10 quintillion insects – and we are reminded how vast the living world of nature is.  Human beings share this earth with all these living creatures and only represent one species out of tens of millions.  While it is no doubt that we are the dominant species in modifying, building creating and overcoming our environment to make it easier for us to live, we still only represent a small fraction of all the co-inhabitants of this earth both in numbers and even in actual mass. 

All this is a constant reminder that humans, representing such a small portion of all living beings, have you could look here no right to destroy the environment, the nature of this world, due to their activities. As Spinoza says, God is Nature and Nature is God. So, let us never forget the environment and our duty to protect it

Action and dharma

Our actions are what define us.  Just thoughts, however good they may be, unless proceeded by action, remain just theoretical.

The philosophical study of action and its motives dates back to Ancient Greece and India.  To be clear, my reference to “action” is intentional action or things that people genuinely do.  

As Aristotle said, in order for a man to perfect his humanity, he must be the best man he can be. To be his manly best, a man not only needed to cultivate proper intentions and an appropriate disposition, but put those intentions into real virtuous action.

In ancient Indian philosophy, the goal of the early portion of the Vedas is action, in particular moral or dharmic.  A human being is defined by his or her actions and the actions are what defines the persons’ dharma.

Even if we aim for virtuous actions, the world has become so complicated that it is hard to know if the action is truly virtuous.  The degrees of freedom between an action and it’s consequence or consequences can be so numerous that it is impossible to know if the action was good. This problem of unintended consequences could have the effect of making almost all actions non-virtuous. So, what is one to do? The only real practical answer is to still act in good faith within one’s cognitive visibility or horizon. Otherwise if we try and analyze too many possibilities it could result in paralysis by analysis.

I personally have always tried to act in a way that is purposeful.  My actions are usually preceded by rational thought and logic, which is somewhat consequential or utilitarian in that I would try and evaluate the course of action by what it can achieve vis a vis other choices.  This has largely been my principle, my dharma and has mostly served me well and it suited my predominantly analytical mindset.

But not too long ago there has been somewhat of a change.  Recently an old colleague asked our college class group for money to help his son’s education, having fallen in difficult times in his career. This was not the first time he had asked, and we all came to know that he has asked other family and friends for money in the past. I thought about this – rationally and logically – and argued against contributing, citing that this has become a ritual and habit of his, that there are better places to put my money, why can’t he send his son to a college within their means and so on and so forth. It all made sense based on the principles that have normally governed my actions.  Then suddenly I contributed. Not out of guilt or coercion, rather it dawned on me that all my analysis was really to serve myself – the only thing that mattered at that time was there was a friend in need and that I could take a small action to help. Period,

Soon after that another incident happened in which an aging family member was raising a fund to support their special needs son so he can live in an appropriate institution.  The immediate analytic assessment was why have they not been planning for this for the last fifty years and so on.  But I stopped short in my tracks and chided myself –  who was I to question their life and their lack of setting enough aside for their son, neither do I know the complete picture and neither am I qualified to judge them.  They have a need and I can help, so I should act, and I did.

The analysis, the justification, the rationalization is sometimes how we attach ourselves to the results or fruits of the action – it seems like we do that more for ourselves, thus in a way it is for selfish means.  While action based on the analysis of the results is clearly still needed in order to achieve certain goals, needs and comforts in life, it was truly liberating to simply act without any analysis, purely on the basis of the need to act, completely without attachment.  I am sure in life there is a balance of the two, which I am yet to figure out. I am not planning on abandoning the dharma that has served me, but the new dharma, if I may call it that, has been satisfying.

Dharma truly is subtle.

Toby Farms

“Second place goes to the team whose silver on their t-shirts shined….”

We had all been up since 6am and were exhausted. The team didn’t win a prize in any of the categories and were disappointed; we just wanted to go home. But, suddenly, our ears perked up – we have silver on our T-shirts?

The announcer continued calling out “..Team 36052, Toby Panthers..”

The kids went wild, Ms. Ebersole literally fell off the stands, I just sat there in disbelief and the Principal Ms. Garner burst out in tears.

First Lego Robotics Team – Toby Farms Intermediate, Chester, PA

It all started in June when i was cleaning my basement and found boxes of old Lego robotics equipment from 4 years ago when i coached my son’s team.  Just donating equipment has minimal impact – it needs to come with human help.  I remember the kids in our district enjoyed the program, but it was one of many choices and opportunities they have, so it was always difficult to see the real impact.  So I decided to try and start a robotics program at a less privileged school district.

Toby Farms Intermediate  is a middle school in Chester, PA, an under privileged, economically disadvantaged community with the same issues that face some of our inner cities. Many kids face difficult family and environmental issues that get reflected in the school and its performance. With lack of resources, despite the efforts of their dedicated staff, significant challenges exist in the school. Ms. Garner is trying to do everything she can to bring new opportunities to the kids – so when she got my email out of the blue, she immediately responded.  It took us several meetings and logistical challenges to finally get the program started in late September. Then my mother fell sick and I left for India.

We finally got going in October – already over 6 weeks behind most teams.  Working with these kids was a completely new experience.  Most had not even touched Lego pieces before.  Every step of the way had logistical issues – from a space to meet, to bussing issues to arranging a computer and so on.  It was difficult to get a consistent group of kids showing up each meeting and thus there was no continuity – but that was all ok, our expectations for the first year was just to give them exposure.

In November, I found myself back in India.  When I was away, we had to cancel meetings as there was no one else to coach.  In December my mother passed away. It was an extremely difficult time for me and I considered stopping the program entirely, but in the memory of my mother, who lived a very selfless life, I decided to put my grief aside and continue with the kids when I returned.

Three days later i broke my hand!

With the holidays and the loss of days due to bad weather, we were down to a few days before the competition.  But the kids stepped up to the plate and the administration and teachers rallied around them with more practice sessions and support. Still we were barely prepared as the competition arrived.

Getting any prize at the competition would have been immensely satisfying but to come in 2nd overall was almost unimaginable. The entire season sounds like a feel good Disney movie script – from the challenging beginning to all the things that went wrong to the beautifully improbable end.

Winning this prize at the competition means a lot more than most people can imagine for the teachers, administrators and most of all for the students of Toby Farms.  They rarely get such achievements to celebrate. It gives a sense of hope and confidence to these kids that they too are good enough and smart enough to compete with others. We hope it gives them the encouragement and excitement to remain inquisitive and try new things.  The entire school is abuzz with excitement right now.

I want to personally thank everyone at PennFLL for giving us the opportunity to participate in the tournament and for their encouragement and support. We look forward to continue to be part of FLL in the City and hopefully give a lot more kids of Toby Farms exposure to this program.



The Net neutrality issue is complicated and somewhat misunderstood-  but it is potentially far more important that most people realize. This post attempts to explain the issue.

Imagine if you were driving your new Ford Fusion, about to enter the highway and you were met with a barrier saying “Fords not allowed on the highway – Ford drivers must use local roads”


You would be outraged.

Imagine if you were flying your usual airline from NY to Chicago and during the flight it was announced that the flight will take 4 hours as that airline is no longer allowed to fly directly.

You would be angry.

Internet service providers are like the highway or the airways – they provide a medium for transportation. In the case of the highway it is a medium for cars to travel on and similartly ISP’s provide a medium for data to travel on the internet.

We all expect such utilities like highways or an ISP to provide us unbiased access – i.e to be neutral.   As the highway should not decide which car brand should have access, an ISP should not decide which streaming music service should have access or better access than another.   The consumer should be free to decide which brand of car or which flight they choose or which streaming service they want to use. Whether to buy a truck or a sports car, whether to buy a Ford or Mercedes – that is a consumer choice, depending on their needs and budget – knowing that any of them can be driven on the highway.  Choosing a shorter or longer flight, choosing United or American – that is a consumer choice, knowing that both have equal right to fly in the sky.

This is the crux of the net neutrality debate.   The current administration and the FCC chairman, Mr. Ajit Pai, want to undue net neutrality.  What they are proposing is that the ISP does not have to be unbiased – they can decide not to allow a Ford to travel on it, they can decide which service they will give better or worse access to. They can sell access or quality of access to the highest bidder.  They are being allowed to be the highway that denies access to your Ford because Ford did not pay the highway more than another car company.

So as a consumer when you are trying to choose a service, you will lose the ability to make your own choice. You will not be able to choose a service based on its merit or quality or value – as the ability for that company to provide you the service will depend on whether they can pay enough money to the ISPs.  Thus your choice will be dictated and influenced by the ISPs.

Well you can simply dismiss this as “big business” – but this very different. Yes, different companies have different ability to influence a consumer by advertising – but the difference is that the choice is still yours.  If you are not allowed to drive that Ford on the highway, the choice is effectively taken away from you.

Net neutrality is a complex topic and thus somewhat misunderstood.  A wireless company that throttles your bandwidth speed after a certain amount of usage or charges you more – is not a net neutrality issue – those are just the terms of service of that company.  There is still a significant amount of misinformation on the meaning of net neutrality as it is some nuanced and complicated.  Recently Verizon announced they would throttle streaming access and cap certain streaming quality and several articles said that this was an affront to net neutrality.  That is not true at all.   The ISP’s are access companies providing access to content.  Access providers may have different service levels and quality, similarly Content providers may have different quality and service levels – but Access should not be biased to one Content or another.  Verizon’s throttling applies to all streaming content – it does not distinguish between one or another, i.e. it is still neutral.   Verizon is simply making a business decision on their service and pricing, similar to airlines charging different amounts for baggage – they don’t care what the color or brand of your luggage is.

Ajit Pai is not a technologist.  He is a lawyer that worked for Verizon.  He doesn’t really understand technology, he is just thinking about companies like Verizon who are stand to be the biggest beneficiaries of his rolling back net neutrality.  Start up and small businesses lose – as they will not be able to compete with the larger established companies – it stifles innovation.  Imagine if a new innovative video streaming company is launched with a fantastic product.  But they have to pay the ISP a ton of money to allow their service to be delivered at the same speed as an established company – well guess what – as a consumer you will never see the new company’s service.  To you, their service will appear slow as they were unable to buy equal speed of delivery on the ISP.

The common argument I hear is “ what if one music or video streaming company is impacted…there are more important issues facing us today…”  This is one of the reasons that Ajit Pai is able to try and roll back these regulations so easily – the broader impact is not fully understood.  It is not about music of videos – it is about a much larger issue – the control of dissemination of information on the internet. The media is called the third pillar of democracy – as the media creates checks and balances by providing information to the public.  The internet has become a dominant part of the media, overtaking traditional print and TV. No matter what, we all rely on some ISP to give us access to the internet.  If the ISP can influence what and how information flows through to us, and this can be bought, then we run a major risk of losing control of the media.

Ajit Pai may just be a pawn in a much larger game – a much more dangerous game. One of the first steps in the loss of a democracy, to a dictator, tyrant etc – is the loss of an unbiased media. Once the media can be controlled, it just becomes a propaganda machine.  If the ISP’s neutrality is for sale, it opens up the possibility for bad actors to disseminate their own news and information with priority over others – de facto controlling the media.

The irony is that Ajit Pai’s parents emigrated from India – a country that prides itself on its determination to maintain net neutrality.  A few years ago, Facebook offered free internet access in India with the caveat that FB would control the content that was accessible and it had to be via FB. It was rejected by the people and the government keeping in line with its fierce protection of net neutrality. Ajit Pai should maybe talk to his parents.

Cartoon courtesy Steve Sack, Star Tribune editorial cartoons

Look in the mirror

Just before the elections, I wrote a short note called “My Fears…” and sent it out to some friends.  It described my fears of the implication of a Trump presidency to our society and urged my friends not to vote for Trump. You can read this note here.

The note was partly in response to a sense I had that a larger number of people of South Asian heritage were voting for Trump than expected – a similar trend in with other minority communities.  Over the last several months I have found out that there were many Indian-American voters who actually voted for Trump.  This posting is for them.

To all the Indian-Americans that voted for Trump, I ask you a simple question – can i buy topamax at gnc Look at yourself in the mirror and tell me what you see? 

Is there a big sign on your head saying you are a Trump supporter? I doubt it.  But I am sure you see a brown skinned person.  Now think about this – what do you think Adam Purinton or Chester Doles or Richard Lloyd or Deep Rai’s shooter sees?

Trump and his associates like Bannon and Miller have popularized and legitimized xenophobia, racism and hate. As someone aptly said, the stigma of being a racist has been lifted – it is now getting to be “OK” and “cool” to openly spew the vitriol of racism.

Jewish home spray painted with swastikas,   flyers distributed in several neighborhoods with the words, “Make America WHITE again-and greatness will follow”, notes in community center that read “WERE GONNA BLOW UP ALL OF YOU REFUGEES”, Swastikas all over a subway car,  attempted fire in Indian-American grocery saying “run the Arabs out of the country” – the list goes on.  The number of incidents of hate crimes against south Asians has risen to post-9/11 levels, however hundreds of smaller incidents are going unreported. You can read the article and download a report on this here

Across America, the rise in the populism of racism has emboldened certain people to come out of the margins and shadows.  For many years there has been the very slow process of marginalization of racists – however Trump and his gang have disrupted this progress and as Van Jones said, American is facing a “white-lash”.

So when they see a brown person it’s ok to shoot them as they may be muslim who Trump says are bad; when they see a brown person, they can blow them up as they may be refugees, who they are told are not wanted in American; when they see a brown person they can harass them as they may be illegal immigrants whom they are told are responsible for their job loss; when they a brown person its ok to set fire to their store as they may be Arab and should driven out and now it is ok for the police to take in a brown person going for a walk, albeit a respected scientist, for questioning for suspicious behavior  – and it goes on and on.

I have tried hard to understand why any Indian-American would have voted for Trump with this backdrop. The answers mostly seem based on a misguided view that Trump will be better economically and for their bottom line.  Even if that was true (which is highly debatable), what use is a few extra dollars if the society is torn apart, if you have no dignity and safety and are a third class citizen? What will those extra dollars do when your kids are harassed in school or when you are told to get out of this country?

Some of those that voted for Trump were swayed by the rhetoric of Islamophobia.  To those I once again ask – look at yourself in the mirror and tell me what you see.

So once again, to the Indian-Americans out there who voted for Trump, think about that young man in Kansas, who looked just like and me. Think about what kind of country you want to live in and bring your children up in and look in the mirror again – and ask yourself what do they see.

My Fears….

I wrote this on Nov 1st, 2016 and sent it to many of my friends as I was very concerned about a Trump victory and its impact on our society.

Every society and country has its share of bias, racism, bigotry etc. and America is no different.  However here we address and talk about these issues and try to effect change.  Such change may be frustratingly slow, but there is positive change nevertheless.  This is exemplified by Barrack Obama as our President and by men and women of all color, race, religion rising the highest positions in business, finance, education and government – which was unimaginable just 50-60 years ago.  But slow change can easily be derailed and now we sit at the cusp of an event of historical magnitude that could set this country back decades if not generations.

 This progress, the changing economy and demographics, has given rise to some that believe America only belongs to those descending from white European Christian roots. Trump’s messages have poisoned them with racist and xenophobic hate and given them voice, a pulpit, a medium – emboldening them to come out of the margins and openly spread their Trump legitimized hate.

 I fear a Trump America. 

 I fear for Mr. S., a turbaned Sikh who may be harassed in public, despite an illustrious service career in education as a professor in a major American University,

 I fear for Mr. N, a young autistic man who may be made fun of and bullied because Mr. Trump thinks it is funny to ridicule handicapped people

 I fear for Mr. H, an entrepreneur who is now getting hate mail and threats because of his Muslin faith, while through his company he has created thousands of good American jobs in economically disadvantaged areas.

I fear for young women who will be sexually harassed and their private parts grabbed because the President things it’s cool, or be treated just like a “piece of ass” the way he refers to his daughter.

I fear for Mr. D, a Jewish American businessman who may face new uprising of anti-Semitism, despite donating hundreds of millions of his personal wealth for causes around the country (while Trump has given almost none).

I fear for Ms. S, a black mother who now fears that her teenage son’s life will matter less and he will be profiled, randomly searched and not be able to travel the county without worrying about being beaten or harassed or called the “N-word” by white supremacists empowered by the occupant of the oval office.

I fear for Mr. M, small town barber of American of Mexican descent who always has a smile on his face and gives customers a great haircut – he will now be looked upon as a rapist and drug dealer, unfit to do his profession.

I could go on and on. 

But most of all, I fear for my children, who were born and brought up here. They stand up for the American flag and sing the national anthem.  What will I tell them when they are bullied in school or told to go back to their country? I have established roots for forty years, paid millions in taxes (unlike Trump) and contributed to society and I have told them that despite its faults, this is the greatest country in the world. How do I explain to them that the only country they really know may not want them because of the color of our skin?

If we make a mistake on Nov 8th, we could tear the heart and soul out of this country, we would tear apart the beautiful fabric of diversity that this country was built upon. If my fears come true, it could be the beginning of the end of the great American century.

Even if you believe an outsider can shake up Washington, Trump is not the one to do it – he represents all the corruption and abuse of the system that he pretends to be fighting against – and any miniscule benefit will be dwarfed by the potential destruction of our society, 

So please think about this – these fears and not just mine but should be all of ours. And please go out and vote on Nov 8th with a strong sense of human consciousness.

                                      RJ, A proud Indian-American citizen, husband and father of four

        (note: while the examples are all real people, their names have been hidden)

Efficient binomial model

lopinavir and ritonavir tablets manufacturers A consolidated, efficient and practical model for American options with discrete dividends


The binomial model for pricing American option is well developed with a tremendous volume of research on the topic.  The original model does have several shortcomings which have been addressed by improvements and modifications.

However majority of the research has focused on independently analyzing one particular area or issue with the model, for example convergence, accuracy of greeks and handling of discrete dividends.

While each of these issues have several reasonable independent solutions, the goal of this paper is to construct one consolidated model that is efficient and accurate. The various models that fix single issues cannot be blindly “stitched” together without possible unintended affects.

Several approaches mentioned below, in particular while addressing the discrete dividend issue, rely on a large number of iterations.  The definition of efficiency is a practical model, that can be used in real time trading and risk applications to calculate options value, greeks and implied volatilities fast.

In this paper, the consolidated model developed will address several issues and suggest a practical, efficient and accurate model.

Click here to download the paper. Consolidated Binomial Model RJ 2015