יום שני, 27 ביוני 2011

The socialist binomial distribution


Motivation
The binomial distribution is quite common as it models chain of independent events each with binary distribution, it can also be used when each binary event has different probability this gives the ability to support iterative nature of events. However, the problem arises when we look on the whole picture of n events, in this case the variance is fixed without ability to control it, unlike normal distribution.
The question is how can we remain the iterative nature of the binomial distribution while controlling the variance of the total n events?

The general idea is to change the probability of the event based on the history. For example, if p=0.6 in the first even we use p0=0.6, and let's say we got 0 so in the next event we'll use a raise the probability, say p1=0.66, and if we got another 0 we'll continue to raise the probability, for example, p2=0.69. And the other way around, if we get 1 we will reduce the probability to get 1, so one can summarize that we take chances from the unlikely high to the unlikely low, and this is where the probability got its name from (it is important to add that increasing the variance is also possible when going the other way around)

The challenges
We need to perform these changes in the probabilities in a manner that we would define a distribution with expected values and variance, SB(n,p,v). The expected value should equal to binomial distribution, E(B(n,p)) = E(SB(n,p,v)) = np. The variance will be extension of the binomial variance (V(B(n,p)) = npq) and will be defined as V(SB(n,p,v)) = pq*f(n,v).

Solution Overview
Instead of using a constant p for all events we will define p(n,k)=p+(k-np)*v.
Using this probabilities for each event we will get that expectation is the same and the variance will be defined are Var(SB(n,p,v)) = sum((1-2v)^n) = ((1-2v)^n+1)/2v.
It is interesting to see that (1+2v)^n is a binomial series sum.


Results
Here are the graphs of the SB(100,6,v) where v goes from -0.02 : 0.015


It seems like very nice Gaussians as expected from binomial distributions and we can see that the variance is controlled.

יום ראשון, 29 במאי 2011

משירי ארץ אהבתי

הרבה זמן לא כתבתי אבל הבוקר שמעתי את "משירי ארץ אהבתי" של לאה גולדברג המופלאה והייתי חייב לכתוב את פרשנותי. אז ברשותכם.

קודם כל השיר.
חזרתם? יופי, כי למען האמת מכאן זה יכול רק להדרדר (באמת שיר קסום).

אז על מה השיר?
הפרשנות המקובלת כיום הוא שהשיר על מולדתה של לאה גולדברג: ליטא. וזה ממש מהפך כי עד לא מזמן חשבו שזה על ישראל. הויכוח הזה הוא כמו לנסות למצוא עמק יפה בין כרמים ושדות שבו מגדל בין חמש קומות.

השיר הזה הוא לא על ארץ אלא על אהבת האדם של לאה גודלברג בהדגשה של הטוב אצל האנשים.
בהתחלה גולדברג מתארת את הארץ שהיא כל-כך סגרירית ויש בה רק שבעה ימים אביביים - אבל גולדברג מתעקשת דווקא לתאר עד כמה נפלאים הם שבעת ימי האביב ומתעלמת מ 358 הימים האחרים.
בהמשך גולדברג מתארת מצב עגום של עמל ורעב רק עם שבעה ימי חג - אבל מתעקשת לתאר עד כמה נפלאים הם ימי החג האלה.
ובסוף גולדברג מקנחת בכך שכולם רואים רק את הצדדים המכוערים של אותה הארץ אבל רק היא רואה את היופי שבה ומפיצה את נקודות האור בה.

לי זה מאוד מזכיר את דירה להשכיר כאשר כולם רואים רק את הדברים הגרועים בדיירי הבניין אבל היונה רואה רק את הטוב שבאדם והיא זו שמשכינה את השלום.