# Turing machine with k-tape, tape of output

Consider a Turing machine with input alphabet $$\{a,b\}$$ that computes the following function:

$$f(w, v) = \begin{cases} w & \text{if } \operatorname{length}(w) > \operatorname{length}(v), \\ v & \text{otherwise}. \end{cases}$$

I wish to use a TM with two tapes, the first of which contains the input string, say encoded as $$*w*v*$$. I'm not sure, having read several books, which tape is the output tape in this case. For example, the output tape for a TM of two tapes is the input tape or the second tape? If I use three tapes, is it correct that one of them contains the input, another is a working tape, and the third is the output tape?

• Unless otherwise specified, it is usually up to you to decide on which tapes the input and outputs will be placed (possibly on the same tape, e.g., in a machine with only one tape). One possible choice is to have a read-only input tape, some read/write working tapes, and one read(/write) output tape. – Steven Nov 7 '19 at 17:44
• The output tape in the above comment should have been (read/)write, i.e., you need to be able to write to it. – Steven Nov 7 '19 at 19:28