martes, 5 de diciembre de 2023

5to ejercicio

 









// Ouput: accepts if n is a palindrome

// Example: accepts 10101

//

// Palindrome Algorithm

// for Turing Machine Simulator 

// turingmachinesimulator.com


name: Binary palindrome

init: q0

accept: qAccept


q0,0

qRight0,_,>


qRight0,0

qRight0,0,>


qRight0,1

qRight0,1,>


q0,1

qRight1,_,>


qRight1,0

qRight1,0,>


qRight1,1

qRight1,1,>


qRight0,_

qSearch0L,_,<


qSearch0L,0

q1,_,<


qRight1,_

qSearch1L,_,<


qSearch1L,1

q1,_,<


q1,0

qLeft0,_,<


qLeft0,0

qLeft0,0,<


qLeft0,1

qLeft0,1,<


q1,1

qLeft1,_,<


qLeft1,0

qLeft1,0,<


qLeft1,1

qLeft1,1,<


qLeft0,_

qSearch0R,_,>


qSearch0R,0

q0,_,>


qLeft1,_

qSearch1R,_,>


qSearch1R,1

q0,_,>


qSearch0R,1

qReject,1,-


qSearch1R,0

qReject,0,-


qSearch0L,1

qReject,1,-


qSearch1L,0

qReject,0,-


q0,_

qAccept,_,-


q1,_

qAccept,_,-


qSearch0L,_

qAccept,_,-


qSearch0R,_

qAccept,_,-


qSearch1L,_

qAccept,_,-


qSearch1R,_

qAccept,_,-

4to ejemplo

 







// Ouput: accepts if n has

// an even amount of 0s

// Example: accepts 100100

//

// Even Amount of 0s Algorithm

// for Turing Machine Simulator 

// turingmachinesimulator.com

//

// --------- States -----------|

// q0  amount of 0s mod2 == 0  |

// q1  amount of 0s mod2 == 1  |

// qAccept - accepting state   |

//-----------------------------|


name: Even amount of zeros

init: q0

accept: qAccept


q0,0

q1,0,>


q1,0

q0,0,>


q0,1

q0,1,>


q1,1

q1,1,>


q0,_

qAccept,_,-

3er ejemplo

 








// Ouput: accepts if n is a palindrome

// Example: accepts 10101

//

// Palindrome Algorithm

// for Turing Machine Simulator 

// turingmachinesimulator.com


name: Binary palindrome

init: q0

accept: qAccept


q0,0

qRight0,_,>


qRight0,0

qRight0,0,>


qRight0,1

qRight0,1,>


q0,1

qRight1,_,>


qRight1,0

qRight1,0,>


qRight1,1

qRight1,1,>


qRight0,_

qSearch0L,_,<


qSearch0L,0

q1,_,<


qRight1,_

qSearch1L,_,<


qSearch1L,1

q1,_,<


q1,0

qLeft0,_,<


qLeft0,0

qLeft0,0,<


qLeft0,1

qLeft0,1,<


q1,1

qLeft1,_,<


qLeft1,0

qLeft1,0,<


qLeft1,1

qLeft1,1,<


qLeft0,_

qSearch0R,_,>


qSearch0R,0

q0,_,>


qLeft1,_

qSearch1R,_,>


qSearch1R,1

q0,_,>


qSearch0R,1

qReject,1,-


qSearch1R,0

qReject,0,-


qSearch0L,1

qReject,1,-


qSearch1L,0

qReject,0,-


q0,_

qAccept,_,-


q1,_

qAccept,_,-


qSearch0L,_

qAccept,_,-


qSearch0R,_

qAccept,_,-


qSearch1L,_

qAccept,_,-


qSearch1R,_

qAccept,_,-

2do ejemplo

 






// Ouput: accepts if n is a palindrome

// Example: accepts 10101

//

// Palindrome Algorithm

// for Turing Machine Simulator 

// turingmachinesimulator.com


name: Binary palindrome

init: q0

accept: qAccept


q0,0

qRight0,_,>


qRight0,0

qRight0,0,>


qRight0,1

qRight0,1,>


q0,1

qRight1,_,>


qRight1,0

qRight1,0,>


qRight1,1

qRight1,1,>


qRight0,_

qSearch0L,_,<


qSearch0L,0

q1,_,<


qRight1,_

qSearch1L,_,<


qSearch1L,1

q1,_,<


q1,0

qLeft0,_,<


qLeft0,0

qLeft0,0,<


qLeft0,1

qLeft0,1,<


q1,1

qLeft1,_,<


qLeft1,0

qLeft1,0,<


qLeft1,1

qLeft1,1,<


qLeft0,_

qSearch0R,_,>


qSearch0R,0

q0,_,>


qLeft1,_

qSearch1R,_,>


qSearch1R,1

q0,_,>


qSearch0R,1

qReject,1,-


qSearch1R,0

qReject,0,-


qSearch0L,1

qReject,1,-


qSearch1L,0

qReject,0,-


q0,_

qAccept,_,-


q1,_

qAccept,_,-


qSearch0L,_

qAccept,_,-


qSearch0R,_

qAccept,_,-


qSearch1L,_

qAccept,_,-


qSearch1R,_

qAccept,_,-

1er ejemplo



// Ouput: accepts if n is a palindrome

// Example: accepts 10101

//

// Palindrome Algorithm

// for Turing Machine Simulator 

// turingmachinesimulator.com


name: Binary palindrome

init: q0

accept: qAccept


q0,0

qRight0,_,>


qRight0,0

qRight0,0,>


qRight0,1

qRight0,1,>


q0,1

qRight1,_,>


qRight1,0

qRight1,0,>


qRight1,1

qRight1,1,>


qRight0,_

qSearch0L,_,<


qSearch0L,0

q1,_,<


qRight1,_

qSearch1L,_,<


qSearch1L,1

q1,_,<


q1,0

qLeft0,_,<


qLeft0,0

qLeft0,0,<


qLeft0,1

qLeft0,1,<


q1,1

qLeft1,_,<


qLeft1,0

qLeft1,0,<


qLeft1,1

qLeft1,1,<


qLeft0,_

qSearch0R,_,>


qSearch0R,0

q0,_,>


qLeft1,_

qSearch1R,_,>


qSearch1R,1

q0,_,>


qSearch0R,1

qReject,1,-


qSearch1R,0

qReject,0,-


qSearch0L,1

qReject,1,-


qSearch1L,0

qReject,0,-


q0,_

qAccept,_,-


q1,_

qAccept,_,-


qSearch0L,_

qAccept,_,-


qSearch0R,_

qAccept,_,-


qSearch1L,_

qAccept,_,-


qSearch1R,_

qAccept,_,-

miércoles, 22 de noviembre de 2023

Resumen de la pelica del CODIGO DEL ENIGMA

 Esta pelicula para mi relata la historia de Alan Turing y los esfuerzos de su equipo para descifrar la máquina Enigma alemana durante la Segunda Guerra Mundial. A pesar de los reveses iniciales, la máquina de Turing finalmente logra descifrar un mensaje Enigma, lo que permite a los aliados detener un ataque alemán. Sin embargo, Turing se enfrenta a un dilema moral cuando decide mantener en secreto el descifrado de Enigma, lo que le lleva al sacrificio de algunas vidas. Turing y Joan informan al M16 sobre su éxito, pero se les advierte que lo mantengan en secreto. El vídeo también explora las luchas personales de Turing con su homosexualidad y la persecución que enfrentó por ello. En última instancia, el trabajo de Turing inspira a futuros investigadores en el campo de la informática y su historia sirve como recordatorio para aceptar nuestras diferencias y desarrollar nuestras cualidades únicas hasta su máximo potencial.

Programa de palindron

 


5to ejercicio

  // Ouput: accepts if n is a palindrome // Example: accepts 10101 // // Palindrome Algorithm // for Turing Machine Simulator  // turingmach...