Why is $10\frac{\exp(\pi)-\log 3}{\log 2}$ almost an integer?

I read that $$10\frac{\exp(\pi)-\log 3}{\log 2} =318.000000033252\dots \approx 318$$

Is this simply a coincidence or can this somehow be explained?


Here's one answer. The expression you wrote contains three binary operations and four unary operations. This becomes more obvious when you view the parse tree:

    (*)
     |
 --------
 |      |
id     (/)
 |      |
10   --------
     |      |
    (-)    log
     |      |
   -----    2
   |   |
  exp log
   |   |
   pi  3

We can count how many similar expressions there are, and see what the probability that one of them is that close to an integer is. This will give us an idea of whether the result is due to chance or not.

To be concrete, we restrict ourselves to the four binary operations $+$, $\times$, $-$ and $\div$ in any combination, and say that the leaves of the trees can be any of the numbers $1,2,\dots,10$ or $\pi$, optionally combined with one of the operators $\exp$, $\log$ or $\mathrm{id}$ (the identity function). We'll discount the expressions that are obviously integers , such as $1+(2+(3+4))$, but that won't be very many expressions compared to the total.

Then it becomes a simple counting argument. Every expression is represented as a binary tree with values at the leaves. There are 33 possible leaf values (11 numbers $\times$ 3 operators) and 4 possible values at each node.

There are three nodes in the tree and 4 leaves, and there are 5 possible binary trees with three nodes. Therefore the total number of expressions is

$$4^3 \times 33^4 \times 5 \approx 3.8 \times 10^8$$

Therefore, to a very rough approximation we can say that we would expect there to be one expression that was within

$$1/(3.8\times 10^8) \approx 2.6\times 10^{-9}$$

of an integer. Since your example is only within $3\times 10^{-8}$ of an integer, I feel fairly confident in saying that it is due to pure chance (or someone with a lot of time on their hands) and there isn't necessarily a deeper explanation for it.