Category Archives: Math

Interview brainteaser asked at Google

Problem. You are in the room with n computers. Some of them are good, and some of them are bad. You can query any computer about the status of any computer in the room. Good computers will always tell you … Continue reading

Posted in Interview, Math | Tagged , | Leave a comment

Popular computer science interview question: thieves locking treasure in cryptographic way :)

This problem is quite common in interviews with people coming from computer science background. The problem is from some famous paper on cryptography. Problem. 7 thieves stole treasure. They would like to place N locks on it. Each lock can … Continue reading

Posted in Interview, Math | Tagged , , | Leave a comment

Interview question: what is the expected number of occurrences of a “HH” pattern in n tosses of an unbiased coin?

Problem: You toss a fair coin times. What is the expected number of occurrences of HH pattern? Math solution. Let to denote the expectation we are looking for. Let to denote the conditional expectation given that the first toss is … Continue reading

Posted in Interview, Math, Probability Theory | Tagged , , | Leave a comment

Note on a differencing and lag operators in time series modeling

Differencing operator is defined by Lag operator is defined by: It is common to see in literature the following: Authors often omit to say that in the last equality is an operator whose definition is the preceding equation; the last … Continue reading

Posted in Math, time series | Tagged , | Leave a comment

Meaning of entropy, Kullback–Leibler distance and mutual information

Recently I came across a nice read about entropy by Cover and Thomas. I want to summarize what entropy ‘physically’ means from information coding perspective. The definition of entropy for a discretely valued random variable is: Entropy does not depend … Continue reading

Posted in Machine Learning, Math, Probability Theory | Tagged , , , , | Leave a comment