Posts

Probability and it's probability!

This post seeks to find a free meeting room in my office floor. The shores of Dirac Sea has an interesting puzzle about probabilities which also inspired the results of my findings. Let us say that someone gives you a lopsided bet. Say that with probability \(r\) one gets heads, and with probability \(1 - r\) one gets tails, and you have to pick heads or tails. You only know the outcome of the first event. Let's say after the first toss it came out heads. What is the probability that \(r > 1/2\)? The question seems redundant, the outcome of a bet is determined by another event's probability, basically what we are dealing with is - the probability, of a probability ! One day when going to one of the meeting rooms in my office floor for our daily meeting, none of the meeting rooms were vacant, since this had happened a number of times before as well I thought how would I know if any of the meeting rooms is empty or not. It immediately made me wonder how I could calcul

Optimal server estimate with Markov chains

Image
I was learning about Markov chains while reading about Hidden Markov Models (HMMs), they are used in understanding and decoding the meaning behind speech. Working on system design and architecture concepts, I saw an analogy of this concept, for using them for finding an optimal number of servers for your micro-service. This post has been long overdue though, since July 16 to be precise, the day ' Amazon Prime-Day ' took place this year ; marked by great discounts it attracts a colossal amount of consumers to buy things they do not particularly need, from a motley of categories like clothes to furniture to books to whatever you can imagine (not guns, that's illegal ! .. wait, not anymore in 'some' parts of the world ) The post is inspired by that busy day for servers, where multiple customer requests hop from one server to another, sporadically sky-rocketing the read/write load on the them. For lucidity and ease of understanding, consider that there are only 5 c

Probability of success: False uniqueness bias

Image
It's very ideal to see that the path we choose, be it for success or anything else we try to achieve is unique, our own to follow. An extreme example I see is when a person models their own idea/business on someone else's yet have a false uniqueness bias . It made me wonder to what extent such a thing can be actually be true. This blog post is a naive mathematical approach I have adopted to dispel the fact that even our ways to success are in fact not as unique as we may feel they may be,such that at-least one other person apart from us is following it; thus, trying to prove the false uniqueness bias. Assuming the maximum number of unique path-ways to be successful is equal to the number of people in the world ,~7 billion (1 way to success for each person): \(\mu=7,000,000,000\) Let's take another assumption, that the path chosen is uniformly distributed across the \(\mu\) number of ways. Let \(success_i\) be the path of success the \(i^{th}\) person chooses,

The noise inside your head

Image
Have you ever felt that your head was full and you couldn't think more? To my surprise, that was not just a metaphor, it was quite literally true! For an ever-growing, learning brain, and to keep in-taking information, there is a big price humans have to pay! Not delving into the biology of our brain, I'll try explaining things in a computer scientist friendly way; every-time our brain intakes new information/data, we make stronger synapses (connections) between nerve cells. The strength of these synapses determines how easily we can retrieve information from our brain, and consequently, some synapses become stronger/larger when we repeatedly intake the same information (thus when we want to memorize something, we find revision helpful for later retrieval.) In a single waking day, synapses continuously strengthen/enlarge as we absorb all kinds of experiences, but this process can't happen indefinitely as synapses reach a saturation point - hence 'our head becomes

Hardest logic puzzle : Bottom-up approach

Image
The following question was dubbed the hardest logic puzzle, published in 1996, written by the renowned founder of theoretical computer science, Raymond Smullyan. One of the reasons I took it up in this blog was because after reading many articles explaining the answer, they were more of a reverse engineered solution and none of them, in my opinion,worked up-to the solution such that I could solve any question of this form posed(reason why I was not content with such explanations). Here's the Hardest Logic Puzzle Ever  : Three gods A, B, and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for “yes” and “no”

Hypothesis to die for, an unbiased die?

Image
Is it possible that the dice (singular form: die) that we get with our monopoly game/other games is not within the rules of it being called an unbiased die ? Maybe not. Hypothesis : Die is unbiased To test this hypothesis, the first question that arises (due to sheer lassitude) is - what will be the minimum number of tests/throws to get enough data of statistical importance? According to Pearson's \(\chi^2\) test   , the rule of thumb is to atleast have 5 times the total sample space of a single die. The die has 6 sides, so we need atleast 30 tests . To get more significant results, this will be repeated 3 times to give better results. In the first test, we threw the die  40 times  and its values are: 6,4,3,1,2,5,3,1,4,2,5,3,1,1,3,2,5,3,1,2,3,5,4,2,3,6,1,4,2,3,4,2,5,6,2,3,1,2,6,4 : \(sum=127\) Throw methodology: All throws were made with the right hand pivoted at a point and arc length of the throw was marked such that the same distance was covered and spee

Wrapping my head around a 'wrap around' : Aliasing

Image
Digital images are formed by transforming illumination energy into a voltage by the combination of input electric power and sensor material which is responsive to the energy being detected. The output waveform/voltage is a continuous signal which is changed to a digitized form, by sampling. [1] When these images are rendered on computer screens an effect that is noticed oft-times especially in video-games is aliasing . The image on the left illustrates aliasing, it is a checkered texture that becomes irregularly shaped as the distance increases and the edges become jagged where the tiles are closer. So this question arises, what causes images/videos to be aliased when they are simply just multiple pixels on a screen? The answer is not as simple as I hoped it would be as the pith of its explanation lies deep in the roots of signal processing. Each image can be thought of as a 2D matrix of values for each R,G and B component of its colour, i.e, three 2D matric