Teaching Kids Programming – Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048


Teaching Kids Programming: Videos on Data Structures and Algorithms

Given x is a positive integer, find tex_301fb3d28e7db746dc7a595621bef5d8 Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video such that tex_f98168f20e266f2cb56d9dde7115523a Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video

Math Exponential Formula

The exponential formula: tex_2ea8490f26aa02f485060f80abc3193e Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video
Thus: tex_106b67051a7d077bfe34ed31e089900d Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video
tex_7f9696d25301e26a688c16ed546d7040 Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video
tex_3c84e34421dcd88b438f45b299a259ff Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video
tex_e318f58d420e40704ec48c9b3e87b966 Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video
Thus: tex_bfd47d9df66c185096e237e6d8ac672c Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video

Bruteforce – Linear Search Algorithm

The upperbound of x can be set to 2048 because tex_5ca7b304075bae9b503ceecec9af907a Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video is greater than tex_93b8e41100b47a602d2c85067b4ec075 Teaching Kids Programming - Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048 algorithms binary search math python teaching kids programming youtube video .

1
2
3
4
T = 2**2048
for x in range(1, 2048+1):
    if x**x == T:
        print(x)
T = 2**2048
for x in range(1, 2048+1):
    if x**x == T:
        print(x)

Binary Search Algorithm to Find Root to Equation

We can binary search:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def f():
    L = 1
    R = 2048
    T = 2**2048
    while L <= R:
        m = L + R >> 1
        mm = m**m
        if mm == T:
            return m
        if mm > T:
            R = m - 1
        else:
            L = m + 1
    return -1  # solution not found
def f():
    L = 1
    R = 2048
    T = 2**2048
    while L <= R:
        m = L + R >> 1
        mm = m**m
        if mm == T:
            return m
        if mm > T:
            R = m - 1
        else:
            L = m + 1
    return -1  # solution not found

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
520 words
Last Post: Teaching Kids Programming - Maximum Absolute Value of Sublist via Kadane's Algorithm
Next Post: Teaching Kids Programming - Top K Frequent Elements (Heap and Counter)

The Permanent URL is: Teaching Kids Programming – Binary Search Algorithm and Exponential Formula (MATH) to Solve Equation x^x=2^2048

Leave a Reply