• Home
  • Textbooks
  • Computability, Complexity and Languages: Fundamentals of Theoretical Computer Science
  • Calculations on Strings

Computability, Complexity and Languages: Fundamentals of Theoretical Computer Science

Martin Davis, Elaine J. Weyuker

Chapter 5

Calculations on Strings - all with Video Answers

Educators


Chapter Questions

01:41

Problem 1

a) Write the numbers 40 and 12 in base 3 notation using the "digits" $\{1,2,3\}$.
(b) Work out the multiplication $40 \cdot 12=480$ in base 3 .
(c) Compute $\operatorname{CONCAT}_n(12,15)$ for $n=3,5$, and 10 . Why is no calculation required in the last case?
(d) Compute the following: UPCHANGE ${ }_{3,7}(15)$, UPCHANGE $_{2,7}(15)$, UPCHANGE $_{2,10}(15)$, DOWNCHANGE $_{3,7}(15)$, DOWNCHANGE $_{2,7}(15)$, DOWNCHANGE $_{2,10}(20)$.

Nick Johnson
Nick Johnson
Numerade Educator

Problem 1

Write a program in $\mathscr{S}_n$ to compute $\#(u, v)$ as defined in Exercise 1.3.

Check back soon!
03:51

Problem 1

Construct a Post-Turing program which computes $f(x)=x^{\mathbf{R}}$ strictly. (See Exercise 2.2.)

Chris Trentman
Chris Trentman
Numerade Educator

Problem 2

Show that the function $f$ whose value is the string formed of the symbols occurring in the odd-numbered places in the input [i.e., $\left.f\left(a_1 a_2 a_3 \cdots a_n\right)=a_1 a_3 \cdots\right]$ is computable.

Check back soon!

Problem 2

Show that $f(x)=x^{\mathbf{R}}$ is computable in $\mathscr{S}_n .\left(x^{\mathbf{R}}\right.$ is defined in Chapter 1 , Section 3.)

Check back soon!
02:41

Problem 2

(a) Construct a Post-Turing program using only the symbols $s_0, s_1$ which computes the function $f(x)=2 x$ in base 1 strictly.

Chris Trentman
Chris Trentman
Numerade Educator
07:08

Problem 3

Let $\#(u, v)$ be the number of occurrences of $u$ as a part of $v$ [e.g., $\#(b a b, a b a b a b)=2]$. Prove that $\#(u, v)$ is primitive recursive.

Chris Trentman
Chris Trentman
Numerade Educator