I have been struggling with the following question and would greatly appreciate any help  :)


  Suppose we have information about the supermarket purchases of 100 million people. Each person goes to the supermarket 100 times in a year and buys 10 of the 1000 items that the supermarket sells. We believe that a pair of criminals will buy exactly the same set of 10 items at some time during the year. If we search for pairs of people who have bought the same set of items, would we expect that any such people found were truly criminals? Assume our hypothesis to be that a pair of criminals will surely buy a set of 10 items in common at some time during the year. 


This is meant to be an illustration of Bonferroni's principle. Suppose there are no criminals and that everyone behaves at random. Would we find any pairs of people who appear to be criminals?

We must initially find the expected number of pairs who buy the same 10 items per year. I'm not sure whether I do this correctly...

Here is how I've been going about solving it:

Number of possible pairs of people: $\binom{10^6}{2} = \frac{10^{12}}{2} = 5 \times 10^{11}$, using the fact that $\binom{n}{2} \approx \frac{n^2}{2}$, when $n$ is large.

Number of possible 10-item selections: $\binom{10^3}{10} \approx 2.6 \times 10^{23}$

Probability of a customer buying 10 particular items at a point in time:
$\frac{1}{2.6 \times 10^{23}}$

Probability of a customer buying 10 particular items at least once over the course of 100 periods in time: $\frac{100}{2.6 \times 10^{23}}$

Probability of a pair buying exactly the same 10 items (both at least once) over the course of 100 periods in time: $(\frac{100}{2.6 \times 10^{23}})^2 = (\frac{1}{2.6 \times 10^{21}})^2 = \frac{1}{6.76 \times 10^{42}}$

The expected number of pairs who buy the same 10 items per year is thus:

$ 5 \times 10^{11} \times \frac{1}{6.76 \times 10^{42}} = \frac{5}{6.75 \times 10^{31}}$

Because the above number is so low if we do find a pair buying the same 10 items then, under our hypothesis, they are likely to be criminals and not a false positive case. 

I am just wondering whether my solution to the above is correct?


Question: Tools to run a background process command line in windows?
Answer: start /min cmd /c mycommand


If you want to run other jobs in the same shell you have to use powershell background jobs

If you want to hide the command window save a vbscript file with the following code(replacing the commands as needed) :

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) &amp; "C:\mycommand_path\mycommand and args" &amp; Chr(34), 0
Set WshShell = Nothing


create a shortcut to this file and run this from the shell directly by double clicking it.  It sounds like what you are really after is job control.  Install the subsystem for unix to get the bash or ksh prompt and execute it from there if you want job control however it would not suprise me if running it as a background job causes issues.  You will probably want to run it as a background process instead.