Big O notation for Cubes in Exterior Measure I am reading the Exterior Measure section by Stein and Shakarchi (2009), specifically where the authors prove the exterior measure of a rectangle $R$ is equal to its volume.
The way the authors approach this to prove the inequality $m_*(R)\leq|R|$ is by first superimposing a grid made of cubes with side length $\frac{1}{k}$ on $R\in\mathbb{R}^d$.
After this overlay, they create two sets: $Q$ and $Q'$, where $Q$ is a set of cubes that are completely contained in $R$ and $Q'$ is a set of cubes that are in both $R$ and $R^c$.
The authors claim there are $O(k^{d-1})$ cubes in $Q'$ and these cubes have volume $k^{-d}$ so that the sum of the volumes of the cubes in $Q'$ is equal to $O(\frac{1}{k})$.
My Question: 


*

*My understanding of Big O notation is that $f(x)=O(g(x))$ is equivalent to $|f(x)|\leq C|g(x)|$ for some constant $C$ and for all $x$ in a given range. ( Big O). So how do you interpret here when the authors claim we have Big O number of cubes? 

*How do you interpret
$$\sum_{Q\in Q'}|Q|=O(\frac{1}{k})?$$
Reference:
$\textit{Real Analysis: Measure Theory, Integration, and Hilbert Spaces}$. Elias M. Stein, Rami Shakarchi. Princeton University Press, 2009.
 A: I think the claim that the number of cubes in $Q'$ is $O(k^{d-1})$ means the usual $\leq C k^{d-1}$, where $C$ is the surface area (interpreted appropriately for the dimension $d$) of the boundary of $R$.
For example, if $d=2$, then the cubes are squares, so the elements of $Q'$ are the small squares that straddle the boundary of $R$. How many such squares are there? Well, if the side lengths of $R$ are $a$ and $b$, and the small squares have side length $1/k$, then there are approximately $2(a+b)k$ small squares intersecting the boundary, because the perimeter of the square is $2(a+b)$ and there are $k$ small squares per unit length along the perimeter. So in this case, $C = 2(a+b)$.
If $d=3$, then the cubes are normal 3-dimensional cubes, and the elements of $Q'$ are the ones that straddle the boundary of $R$. If the dimensions of $R$ are $a \times b \times c$, and the small cubes are $1/k \times 1/k \times 1/k$, then there are approximately $2(ab + ac + bc)k^2$ cubes in $Q'$, because the surface area of $R$ is $2(ab + ac + bc)$ and there are $k^2$ cubes per unit surface area. So in this case, $C = 2(ab + ac + bc)$.
This generalizes in the obvious way to higher dimensions.
Regarding the second question, you would interpret
$$\sum_{Q \in Q'}|Q| = O(1/k)$$
as follows: the number of cubes in $Q'$ is on the order of $Ck^{d-1}$ as argued above, and the volume of each cube is $1/k^d$, so the volume of the cubes in $Q'$ is on the order of $(Ck^{d-1})/k^d = C/k$. This is an upper bound. There may be fewer cubes (even zero) in $Q'$ if the grid happens to align very nicely with the rectangle. So the authors use $O(1/k)$ to mean $\leq C/k$, where $C$ is as above.
The exact value of $C$ doesn't matter; it's some positive constant that depends on $R$ but is independent of $k$.
