McCulloch's second machine

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

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
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'
Transcribed Image 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'
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Properties of Different Architectures
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education