Probability of a subset of the first $n$ natural numbers are prime.

69 Views Asked by At

Suppose we have $P(x) = \frac{1}{n}$ for $x \in \{1,...,n\}.$ Is there a way to find out what the probability is for $P(A_p)$ where $A_p$ is the set of integers $x\in \{1,...,n\}$ such that $x$ is divisible by $p$, where $p$ is prime?

2

There are 2 best solutions below

0
On

Count the members of the set and divide by $n$.

0
On

$A_p=\{p,2p,\dots,mp\}$ where $m$ is a nonnegative integer and $mp\leq n<(m+1)p$.

This leads to $|A_p|=m=\lfloor np^{-1}\rfloor$ so that:

$$P(A_p)=n^{-1}\times\lfloor np^{-1}\rfloor$$

This is valid for any fixed positive integer $p$. It does not have to be a prime.