Posts

Showing posts from April, 2013

The Diet Problem

Q: You are creating a batch of protein bars and want your product to have as much protein in it as possible using two food sources A & B. Source A provides 5g of protein per pound and source B provides 4g of protein per pound. In a batch of the protein bar you do not want more than 4 pounds in total weight. Source A costs $2/pound and B$1/pound. You also want to keep the price of the entire batch to be lesser than \$5.

Practical Optimization

A: This is a good example of an application for the simplex algorithm. The simplex algorithm works quite well for problems that can be formulated in a linear manner with linear constraints. For example, if we assume the optimal amount of source A is $$x$$ pounds and source B is $$y$$ pounds, the objective function we want to maximize (the protein in the bars) can be formulated as follows
$$\text{Protein} = 5x + 4y\\$$
subject to constraints
$$x + y \le4\\ 2x + y\le 5\\$$
The optimal solution can be found using the simplex algorithm. The alg…

Divisibility by Nine Number Trick

A well known divisibility trick exists to tell if a number is divisible by 9. First add all the digits of that number and if the result is divisible by 9, then that number is also divisible by 9. How does one prove this?

Elementary Number Theory (Springer Undergraduate Mathematics Series)

For convenience let us assume it is a 4 digit number we are testing, say $$abcd$$. This can be expressed as
$$\text{abcd} = 1d + 10c + 100b + 1000a$$
This in turn can be expressed as
$$d + c + b + a + 9c + 99b + 999a \\ \text{or}\\ d + c + b + a + 9\times(c + 11b + 111a)\\$$
Note that the second part of the number $$9(c + 11b + 111a)$$ is divisible by 9. If $$d+c+b+a$$ is divisible by 9, then the whole number is divisible by 9. Hence the proof. By extension, as 9 is divisible by 3, the method applies to 3 as well.
The following are some good books on learning probability

BookNotes/CommentsFifty Challenging Problems in Probability with Solutions (Dover Books on Mathematics)This book is a great comp…

Escaping from a Forest

Q: You are stuck in a forest. You have no information whatsoever on where you are in the forest, however you do know that the forest is shaped in the form of a very long rectangular strip of width $$b$$. You decide to walk out of the forest. What strategy would you adopt? If you were on the edge, what is the average expected distance you would walk? Assume you can measure what distance you can walk and can hold the orientation.

The Probability Tutoring Book: An Intuitive Course for Engineers and Scientists

A: A reasonable escape strategy is a fairly simple one. Since you are surrounded by the forest you do not know your orientation w.r.t the forest (see fig). Put in other words, you do not know $$\theta$$.

You pick a direction to walk and walk up a distance $$b$$. Once you have walked that distance you make a $$90^{o}$$ turn to the right and continue to walk a distance (of at most) $$b$$. Using this strategy it is guaranteed that you would hit the boundary of the forest strip!
To Compu…

The Bullet and the Pendulum

Q: A pendulum of length $$L$$ is oscillating with a small angle $$\phi$$. At its end hangs a small spherical ball of diameter $$d$$ and $$d \ll L$$. Another ball of the same diameter is set in motion at a random time such that it crosses the lowest point of the pendulum (see fig). What is the probability of a collision.
The Probability Tutoring Book: An Intuitive Course for Engineers and Scientists (And Everone Else!)

A: As the second ball rolls towards the pendulum at random, the probability of a collision is simply the fraction of time the pendulum ball spends at the lower most phase of oscillatory motion. The period of a pendulum, assuming a small angle of swing is given as
$$T = 2\pi \sqrt{\frac{L}{g}}$$
Note, that during the period of the pendulum it crosses the lowest point twice.

The Pendulum: A Case Study in Physics

The maximum velocity of the pendulum occurs at the point where it is the lowest from the top, where its kinetic energy is the highest and potential energy the low…

An Election Puzzle

Q: A group of 20 members is electing one of two candidates X and Y. You secretly know who will cast in favour of whom and know that X will win by 14 to 6 votes. What is the probability that X will be leading consistently when 12 votes are counted?

The Probability Tutoring Book: An Intuitive Course for Engineers and Scientists (And Everone Else!)

A: As there are 20 votes in total, every path to the final state (14,6) can be thought of to be a state of counts of vote. In order to understand how many possible paths there are, you think of the problem as a combinatorics problem in the following way. When a given vote is counted it is either in favour of X or Y. This is shown in the figure below.

As there are 20 votes total, the number of ways by which the voting process will reach the final state can be ascertained by choosing 14 from 20, i.e. $$\dbinom{20}{14}$$. The zone coloured blue in the figure is a $$6\times6$$ grid. This is a good time to introduce the concept of "Catalan numb…