Sunday, September 5, 2010

Don't tell anyone

How many times someone told you a secret follow by the phrase: "please, don't tell anyone!"?. This is very common, right?, but what I always say is: "if you want your secrets to be private don't say a word", the most probable thing is that all your friends will know your little secret sooner or later. But is this ok?, I mean, is this the most probable thing?.

Well, graph theory is quite useful to figure this out. Let's say you have a group of friends (a big one), and there exist a probability p of telling the secret, this probability is the same on every person and doesn't depend on if the secret has already been told or not. If we say that each person is a vertex of the graph and the action of telling the secret is an edge (A tells B the secret) then we can model our problem very well. Basically, this is the Erdos-Renyi model, so we can use some of its theory to figure this out.

There is an important theorem of Erdos and Renyi: "if G has a minimum degree of at least 1, then G y connected". This means that non of G's vertex is isolated, in our problem this means that non of your friends will end up not knowing your secret.

So what we need to find now is the probability of having a graph with minimum degree greater than zero. In order to do so, we first find the expression of the degree probability of a vertex for a random graph:

For each vertex (one of your friends) we have n taken by k ways to choose k vertices, the probability of having a vertex is p so, the probability of having k vertices is k times p (they are independent). Bah... is very hard to write this in blogger, sorry, it's a binomial distribution!, so the probability of having k vertices is:


if we have a group of 10 friends, and p=0.10, this expression will have this curve:


So if we want to know the probability of having at least one vertex we do:


Which for n=10 friends, we have the following probabilities:



If we read this graphic, telling a secret is not a very good idea, if the probability of telling the secret is more than 0.4 your secret will surely known by ALL your ten friends.

Let's have a graphic idea of the probability of different number of friends:



As we can see in the graph, for the same probability of telling the secret is less probable to this secret to be shared by all your friends if your group number increases. 

So, after this long exercise, we can say: "if you have a secret DON'T TELL ANYONE" :-)


Serious note: Of course this doesn't solve the problem of telling or not the secret, all your friends are different and the probability of telling the secret is not independent, this is just an excuse to talk about Erdos-Renyi model and binomial distributions.

By the way, Erdos was a great mathematician, some people say that he was addicted to coffee, and that's why he could be awake to write all his works, but please, don't tell anyone!


cheers


No comments:

Post a Comment