Suppose $A=\mathbb{Q}$ where $f:A\to\mathbb{R}$ such that:
$$f(x)=\begin{cases} 1 & x\in\left\{(2n+1)/(2m): n\in\mathbb{Z}, m\in\mathbb{N}\right\} \\ 0 & x\not\in \left\{(2n+1)/(2m):n\in\mathbb{Z},m\in\mathbb{N}\right\} \\ \end{cases}$$
How do we prove the following:
- If ${\left(F_r\right)}_{r\in\mathbb{N}}=\left(\left\{c/r!:c\in\mathbb{Z},-r\cdot r!\le c \le r\cdot r!\right\}\right)_{r\in\mathbb{N}}$ (where $\bigcup\limits_{r\in\mathbb{N}}F_r=\mathbb{Q}$) prove that:
$$\forall(\epsilon>0)\exists(N\in\mathbb{N})\forall(r\in\mathbb{N})\left(r\ge N \Rightarrow\left|\frac{1}{|F_r|}\sum\limits_{x\in F_r}f(x)-1\right|< \epsilon\right)$$
- If $\left(G_r\right)_{r\in\mathbb{N}}=\left(\left\{c/d:c\in\mathbb{Z}, d\in\mathbb{N}, d\le r, -dr\le c \le dr\right\}\right)_{r\in\mathbb{N}}$ (where $\bigcup\limits_{r\in\mathbb{N}}G_r=\mathbb{Q}$) prove that:
$$\forall(\epsilon>0)\exists(N\in\mathbb{N})\forall(r\in\mathbb{N})\left(r\ge N \Rightarrow\left|\frac{1}{|G_r|}\sum\limits_{x\in G_r}f(x)-1/3\right|< \epsilon\right)$$
Attempt
I'm not sure how to mathematically prove both statements but I did use code to support my assumptions:
Clear["Global`*"]
f[x_] := f[x] =
Piecewise[{{1 ,
IntegerQ[(Numerator[x] - 1)/2] && IntegerQ[Denominator[x]/2]}},
0] (* This is f(x) *)
F[r_] := F[r] = Range[-r*r!, r*r!]/(r!) (* This is (F_r) *)
G[r_] := G[r] =
DeleteDuplicates[
Flatten[Table[Range[-d d, d d]/(d), {d, 1, r}]]] (* This is (G_r) *)
MeanF[x_] :=
MeanF[x] =
Total[f /@ F[x]]/
Length[F[
x]] (* This is should approach 1 as Length[F[x]] gets larger *)
MeanG[x_] :=
MeanG[x] =
Total[f /@ G[x]]/
Length[G[
x]] (* This should equal 1/3 as Length[G[x]] gets larger *)
{N[MeanF[9]], Length[F[9]]} (* Inputs of code *)
{N[MeanG[200]], Length[G[200]]}
with an the output:
{0.992187, 6531841} (*0.992187 is near 1 *)
{0.335531, 3927193} (*.335531 is near 1/3 *)
How do we verify my assumptions with mathematics?
Edit: One can look at this post; however, the proof isn't very elegant. I believe this site has much better proofs. Is there a way to improve the answer?
You already have linked a nice rigorous proof for both parts. Let’s provide some intuition.
For part (1), note that there are $\lfloor n/2^i \rfloor$ multiples of $2^i$ up to $n$, so
$$v_2(n!)=\sum_{i=1}^{\lceil \log_2(n) \rceil} \lfloor n/2^i \rfloor \geq ( \sum_{i=1} n/2^i ) -\log_2(n) = n - \log_2(n) $$
Thus, $1/2^{n-\log(n)}=n/2^n$ fractions simplify to an odd denominator and this approaches $0$ as $n$ gets large.
For part (2), you’re effectively choosing the numerator and denominator at random. The range of the numerator doesn't matter since $f(x)=f(x+1)$, so we can pretend we’re choosing them independently. Both have a 50% chance of being even. Only the numerator is even $1/4$ of the time, only the denominator is even $1/4$ of the time, and they’re both even $1/4$ of the time, and they’re both odd $1/4$ of the time. Conditioning on the numerator and denominator being relatively prime, we get that the denominator is even and the numerator is odd $\frac{1/4}{3/4}=1/3$ of the time as desired. This isn’t rigorous but does use common heuristics of the prime numbers and can be made rigorous by looking at the error term in the asymptotics of the totient summary function.