Questions about assigning a probability to a randomly chosen large integer $n$ being prime I heard this question a few days ago, so reciting from memory:

If I were to randomly choose an arbitrarily large positive integer $n$, could I write a function that determines the likelihood of it being prime?

Intuitively, what would it mean to assign a probability to an integer of being prime?
Edit 1
I'm not sure how to incorporate the prime-counting function into this.
Edit 2
Alright, so the page on the prime number theorem says that:

Informally speaking, the prime number theorem states that if a random integer is selected in the range of zero to some large integer N, the probability that the selected integer is prime is about 1 / ln(N), where ln(N) is the natural logarithm of N.

Looking through the references, though, I can't find a more formal proof. So I will revise my question.

For a random integer selected in the range of $0$ to some large integer $N$, prove that the probability the selected integer is prime is $\frac{1}{\ln{N}}$.

Edit 3
If the selected integer $n$ was prime, it's necessary that it has no prime factors $p\leq\sqrt{n}$. If we could find the probability that $n$ is divisible by $p$ as some function of $p$, then could we write$$\prod_{p=2}^{\sqrt{n}}\left(1-f(p)\right)$$where $f(p)$ is the probability that $n$ is divisible by $p$?
 A: On your second question, what it might mean to assign a probability to the likelihood of a number being prime, you might want to take a look at this answer, the discussion in the comments under it, and in particular the book that I refer to there, Towards a Philosophy of Real Mathematics by David Corfield.
A: By the prime number theorem it is usually accurate to assume as a heuristic that the probability that $n$ is prime is about $\frac{1}{\log{n}}$.
A: Care should be taken in the sense we take the "density" of primes.
The prime number theorem states that
$$
\pi(n)=\frac{n}{\log(n)}+O\left(\frac{n}{\log(n)^2}\right)\tag{1}
$$
Thus,
$$
\begin{align}
\pi(n(1+\alpha))-\pi(n)
&=\frac{n(1+\alpha)}{\log(n)+\log(1+\alpha)}-\frac{n}{\log(n)}+O\left(\frac{n}{\log(n)^2}\right)\\
&=\frac{n(1+\alpha)}{\log(n)}-\frac{n}{\log(n)}+O\left(\frac{n}{\log(n)^2}\right)\\
&=\frac{\alpha n}{\log(n)}+O\left(\frac{n}{\log(n)^2}\right)\tag{2}
\end{align}
$$
Therefore,
$$
\frac{\pi(n(1+\alpha))-\pi(n)}{\alpha n}
=\frac1{\log(n)}+O\left(\frac1{\alpha\log(n)^2}\right)\tag{3}
$$
In the sense of $(3)$, the density of primes is $\dfrac1{\log(n)}$.
