Skip to main content
restrict challange to 2D Turing-Machines
Source Link
bsoelch
  • 6k
  • 4
  • 5

DrawWrite a Turing machine that draws this fractal matrix

WriteA 2D-Turing machine is like a program of functionregular Turing Machine but the memory tape is 2 dimensional, meaning that takesafter each step you can in addition to moving left or right also move up or down.

[...]

Your task is to create a integer n as input and draws/displays2 dimensional Turing machine that prints the infinite fractal matrix generated by the following algorithmprocedure:

  • It is allowed to output/display any two (distinguishable) distinct colours/symbolscells values for the two different values in the cellsmatrix

  • This is Cells inside the shortest solutionmatrix have to have the correct value more that 50% of the time (per language\$\lim_{steps \to \infty} \frac{correct}{steps} >0.5\$) wins

  • Your solution only needs to handle n between 2 and 8Cells outside the matrix should be empty more that 50% of the time.

  • The score of an answer is the number of distinct cell values used times the number of states of the Turing machine

  • This is (inclusive) the solution with the lowest score wins

related: generate the matrix

  • Is this a duplicate ?

    Is this a duplicate?

  • Should I add an example for n=4 ?

    Is my explanation clear?

  • Should I link to an example implementation of a 2D Turing machine?

Draw this fractal matrix

Write a program of function that takes a integer n as input and draws/displays the matrix generated by the following algorithm:

  • It is allowed to output/display any two (distinguishable) distinct colours/symbols for the two different values in the cells

  • This is the shortest solution (per language) wins

  • Your solution only needs to handle n between 2 and 8 (inclusive)

  • Is this a duplicate ?
  • Should I add an example for n=4 ?

Write a Turing machine that draws this fractal

A 2D-Turing machine is like a regular Turing Machine but the memory tape is 2 dimensional, meaning that after each step you can in addition to moving left or right also move up or down.

[...]

Your task is to create a 2 dimensional Turing machine that prints the infinite fractal matrix generated by the following procedure:

  • It is allowed to output/display any two (distinguishable) distinct cells values for the two different values in the matrix

  • Cells inside the matrix have to have the correct value more that 50% of the time (\$\lim_{steps \to \infty} \frac{correct}{steps} >0.5\$)

  • Cells outside the matrix should be empty more that 50% of the time.

  • The score of an answer is the number of distinct cell values used times the number of states of the Turing machine

  • This is the solution with the lowest score wins

related: generate the matrix

  • Is this a duplicate?

  • Is my explanation clear?

  • Should I link to an example implementation of a 2D Turing machine?

Post Unde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 1 1 1
1 0 1 0 1 0 1 0
1 1 0 0 1 1 0 0
1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 0
1 0 1 0 0 1 0 1
1 1 0 0 0 0 1 1
1 0 0 1 0 1 1 0

n=4:

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1
1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1
1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0
1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0
1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1
1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0
1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1
1 0 1 0 0 1 0 1 0 1 0 1 1 0 1 0
1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 0
1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1
Source Link
bsoelch
  • 6k
  • 4
  • 5

Draw this fractal matrix

This challenge is inspired by and similar to my other challange about a fractal matrix, but uses a slightly different matrix (for n up to 3 the matrices are nearly the same, but for n >= 4 they start to differ more significantly)


Write a program of function that takes a integer n as input and draws/displays the matrix generated by the following algorithm:

  • Start with a single cell, set it to 1
  • repeat n times:
  1. add a copy of the previous matrix to the left of the previous matrix
  2. add a copy of the previous matrix below the previous matrix
  3. add a copy of the previous matrix with 1 and 0 swapped, diagonally to the bottom right of the previous matrix.

First few steps:

n=0:

1

n=1:

1 1
1 0

n=2:

1 1 1 1
1 0 1 0
1 1 0 0
1 0 0 1

n=3:

1 1 1 1 1 1 1 1
1 0 1 0 1 0 1 0
1 1 0 0 1 1 0 0
1 0 0 1 1 0 0 1
1 1 1 1 0 0 0 0
1 0 1 0 0 1 0 1
1 1 0 0 0 0 1 1
1 0 0 1 0 1 1 0

Rules:

  • It is allowed to output/display any two (distinguishable) distinct colours/symbols for the two different values in the cells

  • This is the shortest solution (per language) wins

  • Your solution only needs to handle n between 2 and 8 (inclusive)


Meta:

  • Is this a duplicate ?
  • Should I add an example for n=4 ?