McCulloch's second machine def mcculloch(digits): Esoteric programming languages should be appreciated as works of conceptual performance art. These tar pits are not designed to serve as practical...



McCulloch's second machine

def mcculloch(digits):


Esoteric programming languages should be appreciated as works of conceptual performance art. These tar pits are not designed to serve as practical programming tools, but to demonstrate in a

tongue-in-cheek manner how some deceptively simple mechanism (well, merely disguised as simple, the complexity naturally emerging organically from its simple rules) unexpectedly grants its

wielder the powers of universal computation. Introduced by Raymond Smullyan in one of his clandestine brain teasers on logic and computability, McCulloch's second machine is a string

rewriting system that receives a string of digits between one and nine. The rewrite rule applied to the rest of the digits (denoted below by X) depends on the first digit. Notice how rule for the leading digit 2 is applied to X itself, whereas rules for the leading digits 3 to 5 are applied to

Y=mcculloch(X). This function should return None whenever X or Y is None.


Form of<br>Formula for the expected result (computational operation)<br>digits<br>2x<br>quoting<br>3X<br>Y + '2' + Y<br>concatenation with separator mark<br>4X<br>Y[::-1]<br>reversal<br>Y + Y<br>concatenation<br>anything else<br>None<br>N/A<br>digits<br>Expected result<br>'329'<br>'929'<br>'53231'<br>'3123131231'<br>4524938'<br>'83948394'<br>'343424859355'<br>'4859355248593552485935524859355'<br>'433342717866'<br>'71786627178662717866271786627178662717866271<br>78662717866'<br>

Extracted text: Form of Formula for the expected result (computational operation) digits 2x quoting 3X Y + '2' + Y concatenation with separator mark 4X Y[::-1] reversal Y + Y concatenation anything else None N/A digits Expected result '329' '929' '53231' '3123131231' 4524938' '83948394' '343424859355' '4859355248593552485935524859355' '433342717866' '71786627178662717866271786627178662717866271 78662717866'

Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here