Successively: $\pi \to e \to \log(2) \to G$ were calculated/estimated by sampling uniform distributions.
Method:
With a normal distribution $\pi$ can be calculated with help of the PDF (probability density function). See: Calculate $\pi$ from digits of $\pi$. $$f(x)={\frac {1}{\sigma {\sqrt {2\pi }}}}e^{-{\frac {1}{2}}\left({\frac {x-\bar{x}}{\sigma }}\right)^{2}}$$ The density at the mean value: $\bar{x}$ is equal to the front end of the PDF. This density at the mean can be approximated by a discrete distribution. Where $n$ is the number of counted/observed values at the mean $\bar{x}$, $N$ is the sample size and $\Delta x$ is the distance between two discrete intervals. $$f(\bar{x})=\frac {1}{\sigma {\sqrt {2\pi }}} \approx \frac{n}{\Delta x N}$$ So if normal distributed $\pi$ can be estimated by statistics with: $$\boxed{\pi \approx \frac{1}{2} \cdot \left( \frac{\Delta x N}{ n \sigma} \right)^{2}} \tag{1}$$ In this example I sampled any digit from $[0,1,2,3,4,5,6,7,8,9]$ where $s$ is the number of samples “with replacement”. The standard deviation of the mean can be calculated where: $a=0$, $b=9$ and $s$ sample size. The standard deviation from a discrete uniform distribution I calculated with (and divided by number of samples $s$): $$\sigma=\sqrt{\frac{(b-a+1)^{2}-1}{12s}}$$ The distance between discrete intervals can be calculated with (found empirical): $$\Delta x=\frac{1}{s}$$ From counted observations $n$ at the mean value $\bar{x}=4.5$ and formula $(1)$ the value for $\pi$ can be estimated. However also Eulers number can then be estimated by counting the observations $n_{\sigma}$ at the position of standard deviation $\sigma$ and requiring the estimated value for $\pi$: $$\boxed{e \approx \frac{1}{2\pi} \cdot \left( \frac{\Delta x N}{ n_{\sigma} \sigma} \right)^{2}} \tag{2}$$ In another study regarding discrete circles created with coins mathforums.com I encountered a probability density function with the mean value involving $\log(2)$ and $\pi$, the standard deviation involved Catalan's constant $G$. When sampling $\varepsilon \in [0,\frac{1}{2}]$ over a uniform continuous distribution (random) variable $\alpha$ is found by: $$\displaystyle \alpha(\varepsilon) =2 \cdot \arctan \left( \frac{1}{2\varepsilon} \right)$$ $$\frac{d \varepsilon}{d \alpha}=-\frac{1}{4} \csc^2 \left( \frac{\alpha}{2} \right)$$ The cumulative probability density function of $\alpha$ was found/defined as: $$F(\alpha) =\int_{\pi/2}^{\pi} \frac{1}{2} \csc^{2} \left( \frac{\alpha}{2} \right) d \alpha$$ The mean value was calculated with: $\bar{\alpha}=\int_{\pi/2}^{\pi} \alpha \cdot f(\alpha) \ d \alpha $. $$\overline{\alpha}=\log(2)+\frac{\pi}{2}$$ So when I sample a continues uniform distribution $\varepsilon$ and determine $\alpha(\varepsilon)$, $\log(2)$ can be calculated with help of the estimated value for $\pi$ and the mean value $\bar{\alpha}$ with: $$\boxed{ \log(2) \ \approx\ \overline{\alpha}-\frac{\pi}{2} } \tag{3}$$ The variance of $\alpha(\epsilon)$ was calculated with: $Var(\alpha)=\int_{\pi/2}^{\pi} (\alpha-\bar{\alpha})^2 \cdot f(\alpha) \ d \alpha $: $$Var(\alpha)=-4G - \frac{\log^{2}(4) }{4}+\pi \cdot \log(4)$$ With $G$, Catalan's constant. With the found value for $\log(2)$ and $\pi$ the value for $G$ can be estimated with: $$\boxed{G\approx \frac{-log^{2}(2) + \pi \cdot \ 2\log(2) -Var(\alpha) }{4} } \tag{4}$$ With the code below: $\pi$ and $e$ have been calculated by sampling from digits: $[0,1,2,3,4,5,6,7,8,9]$. Then $\log(2)$ and $G$ have been determined with the calculated $\pi$ and sampling from a continuous uniform distribution between: $\varepsilon \in [0,\frac{1}{2}]$.
With: $s=800$ samples, $N=20000$ trials/size and $R=10000$ repeats. The following values were found:
For easier to read code I did not include all CI (confidence intervals) in sample code below. Those in plots are based upon CI of $\pi$.
Question:
Is there a reason why: $\pi$ and $\log(2)$ are related to mean values and: $e$ and $G$ are related to the standard deviation? Any other information related to method is very welcome also advice in better math formulation.
Attempt [edit]:
In case $e$ and $G$ can be calculated from a mean value there must exist $f(x)$ formula $(5)$. Then I think, there is no relation between mean/stdev and $\pi$, $e$, $\log(2)$ and $e$. But I am not sure how to find such a function. Likely an answer will be more nuanced. $$\bar{x}=\int_{a}^{b} x \cdot f(x) \ d x \to f(\bar{x}) \in [\pi, e, \log(2), G] \tag{5}$$ $$Var(x)=\int_{a}^{b} (x-\bar{x})^2 \cdot f(x) \ d x \to f(\small Var(x) \normalsize) \in [\pi, e, \log(2), G] \tag{6}$$ This is a very open question but hoped for more insight on the math involved.
import numpy as np
import pandas as pd
#Samples, trials (pick trials >1000 to avoid zero counts) and repeats
s=500
N=1000
R=1000
#Set counting arrays to zero
mean_count=[]
std_count=[]
#stdev, sampled stdev and dx uniform distribution [0,1,2,3,4,5,6,7,8,9]
array=[0,1,2,3,4,5,6,7,8,9]
mean=np.mean(array)
var=((array[-1]-array[0]+1)**2-1)/12
stdev=np.sqrt(var)
stdevt=stdev/np.sqrt(s)
dx=1/s
for p in range(R):
#Create Array random numbers uniform discrete
random=np.random.choice(array,[N,s])
#Determine mean no of samples
m=np.mean(random,axis=1)
#Create dataframe and count number of observation per interval
df=pd.DataFrame({'m' : m})
dfg=df.groupby(['m'])['m'].agg(['count']).reset_index()
#Count observation at mean: 4.5
out=dfg[(dfg['m'] < mean +dx/2) & (dfg['m'] > mean-dx/2)]
nc=out['count'].to_numpy()
n=np.sum(nc)
mean_count.append(n)
#Count observation at standard deviations
out=dfg[(dfg['m'] < (mean+stdevt+dx/2)) & (dfg['m'] > (mean+stdevt-dx/2)) & (dfg['m'] > (mean-stdevt-dx/2)) & (dfg['m'] > (mean-stdevt-dx/2)) ]
nc=out['count'].to_numpy()
n=np.sum(nc)
std_count.append(n)
#Statistical pi (by counted observation mean)
mean=np.mean(mean_count)
pi=0.5*(dx*N/(stdevt*mean))**2
print('pi: ' + str(np.round(pi,4)) + " (mean)")
#Error in pi 95% CI
stdev=np.std(mean_count)
stdevm=stdev/np.sqrt(R)
pimin=0.5*(dx*N/(stdevt*(mean+2*stdevm)))**2
pimax=0.5*(dx*N/(stdevt*(mean-2*stdevm)))**2
print(str(np.round(pimin,4)) + "<pi<" + str(np.round(pimax,4)) + " (95%)")
#Statistical Eulers number (by counted observation stdev)
mean=np.mean(std_count)
e=0.5/pi*(dx*N/(stdevt*mean))**2
print('e: ' + str(np.round(e,4)) + " (mean)")
#Statistical log(2) (by mean ya, calc: pi)
epsilon=0.5*np.random.random_sample((N,))
alpha=2*np.arctan(1/(2*epsilon))
log2=np.mean(alpha)-pi/2
print('log(2): ' + str(np.round(log2,4)) + " (mean)")
#Statistical Catalan constant (by stdev ya, calc: pi and log(2))
nvar=np.var(alpha)
G=(-nvar-(log2)**2+pi*2*log2)/4
print("Catalan's Constant G: " + str(np.round(G,4)) + " (mean)")