I'm kind of new to the theory of computation and I was working on this problem:
We say that a Turing machine $M$ uses $k$ squares of tape for an input string $w$ if and only if there exists a configuration $(q, u\underline{a}v)$ of $M$, such that starting with input $w$, $M$ yields $(q, u\underline{a}v)$ and $|uav| \geq k$.
Now show that the following problem is solveable: Given a Turing machine $M$, an input string $w$ and a number $k$ does $M$ use $k$ squares of tape with input $w$?
So the solution I came up with is this:
If it is solvable there has to be a Turing machine $M^*$ that decides $$U = \{\ll M\gg\ll w \gg \ll k\gg\ :M\ \text{uses}\ k\ \text{squares of tape with input}\ w\}$$
And I describe such a machine:
$M^*$ writes in it's tape $w$ and starts operating as $M$ would. After each step of $M$, $M^*$ counts the number consecutive squares of tape from the start of the tape until it finds an empty square, and if that number is $\geq k$ it goes into an accept state and halts. If not, it continues its operation as M would. If $M$ halts without having used at least $k$ steps, $M^*$ goes into a reject state. So $M^*$ decides $U$, and thus the problem is solveable.
So my questions are these:
Is my solution correct?, and
Is my description of $M^*$ precise, or say, good enough?