Friday, 6 May 2016

Petrol pump in a circle

There are n petrol pumps in a circle of circumference L, distributed in an arbitrary manner. Each petrol pump gives $a_i$ quantity of petrol s.t. $\sum_i a_i = L$. You have a car which consumes $x$ quantity for covering distance $x$. You start at an petrol pump with empty tank. Show that there exists an petrol pump starting at which you would be able to go round the circle. (Asked by Rustomji)

Saturday, 12 March 2016

Some similar puzleson inclusion-exclusion

Inclusion exclusion is a common technique for lost of combinatorics puzzles. Here are two I recently encountered:

0. At the banquet of a large conference, n mathematicians hang their coats on the coat rack as they enter. At the end of the night they leave in a drunken stupor, each one randomly putting on a coat without checking that it’s their own. Show that in the limit as n → ∞, the probability that none of the mathematicians staggers home in their own coat approaches 1/e. 

1. 6 persons are standing in a line what is the probability that no three consecutive people are in increasing order of their heightsalso see: https://artofproblemsolving.com/wiki/index.php/Principle_of_Inclusion-Exclusion

2. 6 babies are born in a hospital on either monday, tue, wed, thu. What is the probability that there was no day when no baby was born?

3. 10 people numbered uniquely in 1-10 are uniformly randomly given 10 tickets uniquely numbered b/w [1,10]. What is the probability that none of them get the ticket with same number as the number assigned to them. 

Monday, 29 February 2016

Probability $n$ uniform random points lie on a semicircle

Nice puzzle I read on Saurabh Joshi's blog. What is the probability $n$ uniform random points will lie on a semicircle.

Monday, 25 January 2016

Some problems on sum of subarray that look similar

1) Given an array of non-negative integers and input $x$, find the subarray which sums exactly to $x$. Find $O(n)$ solution

2) No constraints on numbers on array, find the max sum subarray in $O(n)$ time.

3) Given an array of integers and an input $x$, find the subarray with sum closest to $x$ in $O(n\log n)$ time


Sunday, 23 August 2015

Expected number of tosses for consecutive heads

Geometric distribution with parameter $p$ is the number of tosses of biased coint to get first head. The distributions is given by $P(X=k) = (1-p)^{k-1}p$. The expected number of tosses to get first head is $\frac{1}{p}$. Now, the question is to find the expected number of tosses to get the first HH pattern.


Saturday, 15 August 2015

Testing latex support

I had tried adding latex support earlier, using this stack exchange link.  It didn't work, perhaps due to the 'Awesome inc' template I was using. I have now switched to 'simple' template. Let's see if it works  and drum rolls.....voila! $$\LaTeX$$ Easy to use and it is better than wordpress. Wordpress has annoying border around all the tex renderings which I couldn't get rid of.

More examples, inline fraction : $\frac{2}{3}$, $\mathcal{R},\mathbb{R}$ \(\begin{pmatrix} 1 &2 \\ 3 &4 \end{pmatrix}\)

Thursday, 13 August 2015

Puzzle #8: Three dart puzzle

You are throwing darts at a dart board, aiming at the center. The second dart hit the board farther from the center than the first. What is the probability the third dart will also hit the board farther from the center than the first? Assume that all the throws are independent.