
Raw unobtainium ore is only 0.0001% pure unobtainium. For the intended application, building an interstellar starship, the final refined product must be 99.9999% pure unobtainium. When feedstock is fed into a single state-of-the-art separation unit, pure unobtainium particles have a 50% chance of being output in the concentrate and a 50% chance of ending up in the tailings. Non-unobtainium particles have a 90% chance of ending up in the tailings and a 10% chance of being output in the concentrate.
Estimate the minimum number of separation units needed to produce a quantity of final product (99.9999% pure unobtainium) that is half the quantity of pure unobtainium in the raw ore.
Extra credit: Suppose that 1 million metric tons of final product is needed to build the interstellar starship, and correspondingly almost 2 trillion (2 x 1012) metric tons of raw ore is provided. Also, an individual separation unit can process 1 kilogram of feedstock per hour. Estimate how many separation units are needed to produce the amount of final product needed within 90 days.
Non-adjacent permutations
What is the probability that a random permutation of the numbers 1 through 100 will not show any consecutive numbers next to each other?
Eamonn Long submitted the following solution.
Intuitively, we can reason that the probability will be very close to e(-2) ≈ 13.5% since 100! is a very large number. The argument is as follows.
Define a permissible permutation on (1, … , n) to be a permutation with no two neighbors being consecutive numbers.
Let n be a very large integer (sort of representing infinity).
Let us consider where the integer j occurs in that permutation. Since n is large, j will with probability approaching 1 occur somewhere in the middle of the permutation with neighbors on either side.
For a permissible permutation, the options for each side of j are reduced by a factor very close to (1-2/n) and for both sides by (1-1/n)2.
This is true for each j = 1, … , n and since for large n the events of no consecutive neighbors for each j will be close to independent events, the reduction in options for permissible permutations is (1 – 2/nn) or, as n→∞, e(-2).
More rigorous argument
We are interested in constructing the exact probability for each n and showing that, for n=100, there will be no practical difference from just using e(-2) as the probability.
A few definitions are needed.
Let a block within a permutation be a maximal length string of consecutive integers within the permutation. Here, maximal means that adding a neighbor to either side will void the consecutive property. So, for example, we may have one or more blocks in a permutation (or indeed none at all). To make this clearer, consider (1, 2, 3, 6, 4, 5) to be a permutation of (1, 2, 3, 4, 5, 6). In this example, there are two blocks (1, 2, 3) and (4, 5).
An event of interest (EOI) occurs in a permutation when, for some integer j, that j is next on one side or the other j + 1. So, for a block to occur, there must be at least one EOI.
Our strategy is to use the inclusion-exclusion principle to count the number of permissible permutations as those without any blocks.
Claim: Let m be the number of blocks. The number of nonpermissible permutations of (1, … , n) with m blocks and at least k EOI is given by:
((n–k)|m) ((k-1)|(m-1)) (n–k)! 2m
Where (a|b) = a!/b! (a–b)! for a≥b.
Demonstration of claim:
As there are m distinct blocks, there are at least m EOI and at most n–m-1.
Let us attach an index set I to the set of EOI. Let us say that q is in the index set if an EOI occurs at q. Note that there are at most n-1 elements in I. Let k be the size of I and so equal to the number of EOI.
If there are k EOI, this means that there are n–k-1 values where an EOI does not occur, drawn from the set (1,2, … , n-1) and noting that n itself cannot index an EOI.
Between these n–k-1 values there are n–k gaps (including the outside gaps) where a block of EOI may be placed. So, the number of ways of placing m blocks is ((n–k)|m).
Within each possibility of placing the m blocks, there is some variation around the ways of placing the k EOI indices within the blocks of indices. The count of this is well known and is ((k-1)|(m-1)).
As a block may be ascending or descending, there are two choices of orientation for each block, and this gives us 2m choices of orientation to include.
Treating now each Block as a separate symbol, say from a, b, c, …, we now have m+(n–k) from the indices not used for EOIs. However, there are m numbers at the end of each block, leaving =n–k symbols to permute.
Multiply altogether to get the claim for given block number and a given (at least) number of EOIs.
Inclusion exclusion principle (PIE)
There are n! permutations in total. To count the number of permissible permutations, we subtract the number of permutations with at least one EOI, add back in those with at least two EOI, now removing again those with at least three EOI, and so on.
Grouping by blocks, this gives us the number of permissible permutations = n! + 2m [((n–k|m) (k–1)|(m–1)) (n–k)!(–1)k].
Asymptotic behavior
The asymptotic behavior is now more accessible and tends to a proportion of permissible permutations being e(-2).
This is clear(er) when we consider that, for a given m S_(k = m)n [((n–k|m) ((k–1|(m–1)) (n–k)! (–1)k] will be asymptotically tending from below, again use PIE, to (-1)m times the number of ways of permuting n–m objects chosen from n objects without repetition, in other words, then the co-efficient of 2m will tend to -1m (n!)/(m!).
Solutions were also submitted by Krishna Chakravartula, Al Commodore, Bob Conger and Ken Klinger.