Dimensions of Intersections, Exercise 1

Compute the box-counting dimension of the intersection of a Sierpinski gasket and a line segment.
First assume both are subsets of 2-dimensional Euclidean space.
Then assume both are subsets of 3-dimensional Euclidean space.
 
Here are the solutions.