а)-log2(3/4) = -log2 3 + log2 4 = <span>1,586 - 2 = 0,414 бит</span>
C/C++,поформулеарифметическойпрогрессии:
#include <iostream>
using namespace std;
int main(){
int n = 4;
int an = 2 + 2 * (n-1);
int sum = (2 + an) / 2 * n;
cout << sum;
return 0;
}
Ответ:
#include <iostream>
using namespace std;
int main()
{
int n, i;
setlocale(LC_ALL, "Russian");
cout << "\nN = ";
cin >> n;
unsigned long long* x = new unsigned long long [n];
x[1] = 1;
x[2] = 1;
x[3] = 1;
for (i = 4; i <= n; i++)
x[i] = x[i - 1] + x[i - 3];
cout << "\nX [" << n << "] = " << x [n] << endl;
getchar;
}