# Frequency of the Prime Numbers

Suppose I took all natural numbers less than or equal to $x$ and I picked one at random. Is there a way that we know of to express the probability that my number is prime in terms of $x$, for all $x$?

For example, for $x=12$, the prime numbers less than or equal to $x$ are $2,3,5,7$ and $11$, so my probability is $5/12$.

There is no explicit formula, but the prime number theorem says that as $x$ tends to infinity, there are around $\frac{x}{\ln x}$ primes $≤ x$.
This means that the chance that a random number is prime will be around $\frac{x}{\ln x} \cdot \frac{1}{x} = \frac{1}{\ln x}$.
• $\frac{1}{\ln x}$ is the chance that a random number selected from the set $\{1,...,x\}$ will be prime. Aug 8 '18 at 13:22