Suppose we have $P:A\to[0,1]$, where $A$ is the fat cantor set denoted as $C$.
We produce $C$ by removing $1/4$ of $[0,1]$ around mid-point $1/2$
$$C_{1}=[0,3/8]\cup [5/8,1]$$
$$C_{1,1}=[0,3/8] \ \ \ \ \ \ C_{1,2}=[5/8,1]$$
We repeat, removing $1/16$ of $[0,1]$ around each midpoint of remaining intervals $C_{1,1}$ and $C_{1,2}$.
$$C_{2}=[0,5/32]\cup[7/32,12/32]\cup[5/8,25/32]\cup[27/32,1]$$
$$C_{2,1}=[0,5/32] \ \ \ \ \ \ \ C_{2,2}=[7/32,12/32] \ \ \ \ C_{2,3}=[5/8,25/32] \ \ \ C_{2,4}=[27/32,1]$$
Repeat the process until $\lim\limits_{n\to\infty}C_{n}=C$, where $\lim\limits_{n\to\infty} 1/4^n$ of $[0,1]$ around each midpoint of remaining intervals are removed.
I want to find the average such that
$$\lim_{n\to\infty}\sum_{i=1}^{2^{n}} P(t_{n,i})(1/2^n)$$
Where $\bigcup\limits_{i=1}^{2^{n}}C_{n,i}=C_n$ and $t_{n,i}\in C_{n,i}$
How would we use mesh and list manipulation to solve this? Would we get $\frac{1}{2}\int_{0}^{1} P dx$?
EDIT: I found when $P(x)=x^2$, the average I want should be $4/11$ but according to this answer, the average should be $38/105$? Which answer is correct?
For each $n\ge 1$ let $l_{n,i}$ and $r_{n,i}$ be the left and the right endpoints of the segment $C_{n,i}$. Since the function $x^2$ increases on $[0,1]$ and $ l_{n,i}\le t_{n,i}\le r_{n,i}$ for each $n$ and $j$, we have the bounds
$$S_{l,n}=\frac 1{2^n}\sum_{i=1}^{2^{n}} P(l_{n,i})\le \frac 1{2^n}\sum_{i=1}^{2^{n}} P(t_{n,i})\le \frac 1{2^n}\sum_{i=1}^{2^{n}} P(r_{n,i})=S_{r,n}.$$
Put $l_{0,1}=0$, $r_{0,1}=1$. Then for each $n\ge 0$ we have a recurrence
$l_{n+1,2j-1}=l_{n,j}$,
$r_{n+1,2j-1}=(l_{n,j}+r_{n,j})/2-0.5\cdot 4^{-n-1}$,
$l_{n+1,2j}=(l_{n,j}+r_{n,j})/2+0.5\cdot 4^{-n-1}$, and
$r_{n+1,2j}=r_{n,j}$.
This recurrence is a base for the following Pascal program calculating the values of $S_{l,n}$ and $S_{r,n}$ up to $n=9$.
A Delphi version of the program calculated the following values $S_{l,n}$ and $S_{r,n}$ up to $n=12$ and with double precision:
Since $38/105= 0.36 (190476)$, these calculations confirm the answer by Robert Israel;