## Probability of all combinations of k numbers among n being coprime

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

A simple argument shows that if we choose $n$ positive integers at random, the probability of their greatest common divisor being 1 is $1/ \zeta (n)$ (in the sense that if we choose the numbers among $\lbrace 1, 2, 3, \dots , N \rbrace$ uniformly and independently, the above probability tends to some number $p(n)$ as $N \rightarrow \infty$).

In the above sense, what is the probability $p(n,k)$ that among n integers $x_1, x_2, \dots, x_n$ chosen at random we have $\gcd (x_{i_1}, x_{i_2}, \dots, x_{i_k})=1$ for all possible combinations of the $x_{i_j}$ (with $s \neq t$ if for $u \neq v$, $x_{i_u}=x_s$ and $x_{i_v}=x_t$) ?

-

How are the $x_1,\dots,x_n$ chosen? If they are all multiples of two, then the gcd condition never happens.  – Eric Naslund Jan 20 at 18:28
I thought it was clear that they are chosen at random. Just fixed the possible ambiguity. – Alex G Jan 20 at 18:35
You will need fewer than k of them even for that to be possible (which I think is Eric Naslund's point), which will likely be the most prominent condition determining the probability.  Even if you study the relaxed condition that no k of the n numbers have a small prime factor in common, I think you will get good bounds on the probability you seek.  Gerhard "Ask Me About System Design" Paseman, 2013.01.20 – Gerhard Paseman Jan 20 at 20:12

## 1 Answer

For any prime $q$, define $$\ell(q,n,k) = q^{-n} \sum_{j=0}^{n-k} \binom nj (q-1)^j,$$ so that $\ell(q,n,k)$ is the probability, if a biased coin that comes up heads only $1/q$ of the time is tossed $n$ times, that at least $k$ heads are obtained. Equivalently, $\ell(q,n,k)$ is the probability, if $n$ numbers are chosen uniformly and independently from the set ${0,1,\dots,q-1}$, that at least $k$ of the numbers equal $0$.

Then the same argument giving the $1/\zeta(n)$ result shows that the probability that the greatest common divisor of every $k$-subset of $n$ "randomly chosen" integers is $1$ equals $$\prod_q \big( 1 - \ell(q,n,k) \big),$$ where the product is over all primes $q$. This product is convergent as long as $k\ge2$; it diverges to $0$ if $k=1$ (appropriately).

For example, if three integers are chosen at random, the probability that they are pairwise coprime is $$\prod_q \big( 1 - \ell(q,3,2) \big) = \prod_q \bigg( 1-\frac1q \bigg)^2 \bigg( 1+\frac2q \bigg) \approx 0.286747.$$ (A million trials with random integers between $1$ and $10^{60}$ yielded $286912$ pairwise coprime triples, so this limiting probability seems accurate.) I don't believe this product has a closed form in terms of the zeta function.

-

1
This .286747... is also the probability that two positive integers are "strongly carefree," that is, coprime and both squarefree, see Finch, Mathematical Constants, p. 110. Next page, Finch notes the probability $k$ integers are pairwise coprime is $\prod(1-p^{-1})^{k-1}(1+(k-1)p^{-1})$ for $k=2,3$, unproved for $k\gt3$. Some of Finch's references are to unpublished work of Moree. A published reference is Schroeder's book, Number Theory in Science and Communication, pp 25, 48-51, and 54. – Gerry Myerson Jan 20 at 22:13
Nice. Even though as you might have guessed, I was hoping for an answer involving the zeta function. – Alex G Jan 21 at 2:11
The formula in the answer certainly reduces, when $k=2$ (pairwise coprime), to $\prod_q (1-q^{-1})^{n-1}(1+(n-1)q^{-1})$, validating Finch's statement. – Greg Martin Jan 22 at 1:28
Indeed, Toth seems to have proved this statement (about $n$ randomly chosen integers being pairwise coprime) in a 2002 Fibonacci Quarterly paper. ams.org/mathscinet-getitem?mr=1885265 – Greg Martin Jan 25 at 1:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 42, "mathjax_display_tex": 3, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9341465830802917, "perplexity_flag": "head"}