To mock a mockingbird

Algebra Level 4

Consider the following function ("mockingbird") M : f f f M ( f ) ( x ) = f ( f ( x ) ) \begin{aligned} M &: f \mapsto f \circ f \\ M(f)(x) &= f(f(x)) \end{aligned} where M M has a function f f as argument and returns the function composition f f f \circ f of the function with itself.

We now consider the following number: y = ( M M M M ) ( x x 2 ) ( 2 ) y = (M \circ M \circ M \circ M)(x \mapsto x^2)(2) How many digits has the number y y (in base 10)?


The answer is 19729.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Markus Michelmann
May 29, 2018

We evaluate the M M -functions as follows ( M M M M ) ( f ) = M ( M ( M ( M ( f ) ) ) ) = M ( M ( M ( f f ) ) ) = M ( M ( ( f f ) ( f f ) ) ) = M ( M ( f f f f ) ) = M ( ( f f f f ) ( f f f f ) ) = M ( f f f f f f f f ) = ( f f f f f f f f ) ( f f f f f f f f ) = f 16 \begin{aligned} (M \circ M \circ M \circ M)(f) &= M(M(M(M(f)))) \\ &= M(M(M(f \circ f))) \\ &= M(M((f \circ f) \circ (f \circ f))) \\ &= M(M( f \circ f \circ f \circ f )) \\ &= M(( f \circ f \circ f \circ f ) \circ ( f \circ f \circ f \circ f )) \\ &= M( f \circ f \circ f \circ f \circ f \circ f \circ f \circ f ) \\ &= ( f \circ f \circ f \circ f \circ f \circ f \circ f \circ f ) \circ ( f \circ f \circ f \circ f \circ f \circ f \circ f \circ f ) \\ &= f^{16} \end{aligned} where f n f^n denotes a n n -fold function composition. In our case, we have f : x x 2 f : x \mapsto x^2 , so that f 16 ( x ) = f ( f ( f ( 16 times x ) ) ) = ( ( x 2 ) 2 ) 2 16 times = x 2 16 = x 65536 \begin{aligned} f^{16}(x) &= \underbrace{f(f( \dots f(}_{\text{16 times}} x) \dots )) \\ &=( \dots (x\underbrace{^2)^2 \dots )^2}_\text{16 times} \\ &= x^{2^{16}} \\ &= x^{65536} \end{aligned} Therefore, the result y = 2 65536 y = 2^{65536} is a number too large to be explicitly stated here. But we can determine the number d d of digits by calculating the decadic logarithm of y y and rounding it up to the nearest integer: d = log 10 ( y ) = log ( 2 ) log ( 10 ) 65536 = 19729 \begin{aligned} d &= \lceil \log_{10} (y) \rceil \\ &= \left\lceil \frac{\log (2)}{\log(10)} \cdot 65536 \right\rceil \\ &= 19729 \end{aligned} The following Python program explicitly evaluates the number y y :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
from math import *

def square(x):
    return x*x

def M(f):
    def compose(x):
        return f(f(x))
    return compose

result = M(M(M(M(square))))(2)
digits = ceil(log(result)/log(10))

print(result)
print(digits)

Zico Quintina
May 29, 2018

M ( x x 2 ) = ( x 2 ) 2 = x 2 2 M M ( x x 2 ) = M ( x x 2 2 ) = ( x 2 2 ) 2 2 = x 2 4 M M M ( x x 2 ) = M ( x x 2 4 ) = ( x 2 4 ) 2 4 = x 2 8 M M M M ( x x 2 ) = M ( x x 2 8 ) = ( x 2 8 ) 2 8 = x 2 16 so M M M M ( x x 2 ) ( 2 ) = 2 2 16 \begin{aligned} M (x \mapsto x^2) &= (x^2)^2 = x^{2^2} \\ \\ M \circ M (x \mapsto x^2) = M (x \mapsto x^{2^2}) &= (x^{2^2})^{2^2} = x^{2^4} \\ \\ M \circ M \circ M (x \mapsto x^2) = M (x \mapsto x^{2^4}) &= (x^{2^4})^{2^4} = x^{2^8} \\ \\ M \circ M \circ M \circ M (x \mapsto x^2) = M (x \mapsto x^{2^8}) &= (x^{2^8})^{2^8} = x^{2^{16}} \\ \\ &\text{so} \\ \\ M \circ M \circ M \circ M (x \mapsto x^2) (2) &= 2^{2^{16}} \end{aligned}

We can determine the number of digits in any number by rounding down its base 10 10 logarithm and adding 1 1 . So the number of digits in 2 2 16 2^{2^{16}} is

log 10 ( 2 2 16 ) + 1 = 2 16 log 10 2 + 1 = 19729 \left \lfloor \log_{10} (2^{2^{16}}) \right \rfloor + 1 = \left \lfloor 2^{16} \log_{10} 2 \right \rfloor + 1 = \boxed{19729}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...