-1

I am looking to find an algorithm that would let me while starting at the right most of an input string containing blanks in between, merge input symbols so that there are no blanks.

For example, 0 _ 0 _ 0 _ into 000.

I am aware of methods shown in the form of state diagrams to merge input symbols when there are no blanks in between, but I would like to know of good a way to do it when this is not the case.

More example of what I mean by removing input symbols in between (assuming an alphabet of 1,0 for now):

  • Example input: 10011 output: 101
  • Example input: 11101101 output: 1110
Karl Knechtel
  • 62,466
  • 11
  • 102
  • 153
  • 1
    If I understand correctly, you want to output every other character. Can you provide more details about your specific Turing machine in terms of representation. – Luka Rahne Oct 01 '22 at 21:47
  • @LukaRahne sure, what specific information have I missed out? In short, I am looking to delete every 'second' input symbol and then merge the remaining string into a string that has no blank gaps. If by representation you mean in which form, I have been working with state diagrams. – Kieran Anderson Oct 01 '22 at 22:14
  • The site [computerscience.se] might be a better fit for this question. – John Coleman Oct 01 '22 at 22:18
  • @JohnColeman thanks for letting me know. Do you know of any attributes of the traditional turing machine that could be taken advantage of when solving an output problem such as my outputting every other input without trailing gaps? – Kieran Anderson Oct 01 '22 at 22:25
  • "More example of what I mean by removing input symbols in between" These examples do not make it clear at all. Please try to explain, step by step, how you would determine the expected outputs with pencil and paper. – Karl Knechtel Oct 01 '22 at 22:40
  • @KarlKnechtel Suppose I used an accessible turing machine simulator, such as JFLAP, I would use state diagrams to observe the machine's head movement and the resulting string which should not have blanks but have one sequence of input symbols from my alphabet (0,1). And specifically, there would only be blanks to the left and right as expected in any turing machine. As for what the sequence will or should contain, it is only every second input symbol (from initial input string). And I have given three examples. – Kieran Anderson Oct 01 '22 at 22:45
  • I can't understand why we are using a turing machine for this task, and I also cannot understand why the question is tagged as a Python question. – Karl Knechtel Oct 01 '22 at 22:53
  • @KarlKnechtel I would like to know how I can output every other input symbol merged together while working with a turing machine. It is an area I have not found a great deal of information about. Python can be used to implement a turing machine and try out different approaches to problems such as the one I am currently looking at on merging output. – Kieran Anderson Oct 01 '22 at 22:58
  • "Python can be used to implement a turing machine" This is not a reason to tag the question that way. Removed the tag. – Karl Knechtel Oct 01 '22 at 23:00
  • @KarlKnechtel that and an algorithm written in python would have been of help to me but very well. – Kieran Anderson Oct 01 '22 at 23:02

1 Answers1

0

I am not sure you can do that with only 2 alphabet symbols. Basic idea is to use additional (blank) symbol from alphabet and use it as skip characters when moving on tape.

If you know how to solve initial problem, for example 0_1_0 you can can covert arbitrary tape having only 0 and 1 to tape with blanks then proceed from there.

Luka Rahne
  • 10,336
  • 3
  • 34
  • 56