Задача

1/11

How many such numbers? Analytical solution

Теория

Positional number systems

Any number written in the positional number system p can be represented in expanded form. The expanded form of the number – this record in form bit terms , written using the degree of the corresponding category and the base of the degree (the base of the account).
\(A_p = \overline{a_4a_3a_2a_1a_0 }= a_4 \cdot p^4 + a_3 \cdot p^3 + a_2 \cdot p^2 + a_1 \cdot p^1 + a_0 \ cdot p^0\)
\(p^0 = 1\)
 
How to calculate the digits of a number in decimal notation
\(a_0 = A\ mod\ 10\), where mod is the remainder of A divided by 10. 
\(\overline{a_1a_0} = A\ mod\ 100\)
etc.

(in other number systems, we will divide by the base of the number system to the appropriate degree - knowledge of this will be useful in a software solution)
Properties
  For decimal number system (p = 10) For binary number system (p = 2)
1 \(10 ^ N = 1\underbrace{0...0}_{N}\) \(2 ^ N = 1\underbrace{{0...0}_2}_{N}\)
2 \(10 ^ N-1 = \underbrace{9...9}_{N}\) \(2 ^ N-1 = \underbrace{{1...1}_2}_{N}\)
3 \(10 ^ N-10 ^ K = 10^K \cdot (10^{N-K}-1) = \underbrace{9...9}_{N-K }\underbrace{0...0}_{K} \) \(2 ^ N-2 ^ K = 2^K \cdot (2^{N-K}-1) = \underbrace{1...1}_{N-K }\underbrace{0...0}_{K} \)(\(K<N\))
4   \(2 ^ N+2 ^ N = 2^{N+1}\),
therefore
\(2 ^ N= 2^{N+1}-2^N\)
\(-2 ^ N= -2^{N+1}+2^N\)
 
In general
  For a number system with base p
1 \(p ^ N = 1\underbrace{{0...0}_p}_{N}\)
2 \(p ^ N-1 = \underbrace{{(p-1)...(p-1)}_2}_{N}\)
3 \(p ^ N-p ^ K = p^K \cdot (p^{N-K}-1) = \underbrace{(p-1)...(p- 1)}_{N-K}\underbrace{0...0}_{K} \)
4  

Analytical solution algorithm
  1. Represent all numbers in an expression as powers of the specified number system.
  2. Regroup the terms in the expression so that the powers are in descending order.
  3. For a binary number system, using property 4, rewrite the expression so that the sign "-" alternated with "+". 
  4. Using properties 1, 2, 3, find the answer.

Задача

Determine the number of digits in the binary representation of a number
\(8^{502}-4^{211}+2^{1536}-19\).

Выберите правильный ответ, либо введите его в поле ввода

Комментарий учителя