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)
Friday, 6 May 2016
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
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