математика

How to determine the base of the number system of a number?

118924 in 10 numeral system = 350214 in x numeral system, how to find x? if possible, then more comfortable

Chessboard - one formula

I noticed that in chess problems they often draw the board using the condition that if the remainder of the division by 8 is ... { background-image: url('https://gyazo.com/1b53d5bd1715435422adeea81a5fbf73.png'); } <div id="board"></div>

Coordinate-based descent method in Python

There is a function def f(x, y): return (5 * (1 - x)) / (7.88 * (1 - y)) For the one-dimensional optimization problem, I u ... n value is minimal. x, y from the segment [0.0001, 0.9999] Can you give an example of how this is implemented in a human way?

Find a number that is some power of two

The program must enter the natural number n from the console and find the number following n, which is some power of two. For ... 2 active = True while active: for i in range(1, n): if z == x**i: active = False z += 1 z = n print(n)

Write a function that takes any number and returns the sum of the first and last number

Greetings to all. There is such a task: you need to write a function that takes any integer number as input, and returns the ... = 10; } int First = Number % 10; int Last = Number % 10 + Number; return First + Last; }

How to prove that the fraction of an irrational number is non-periodic?

Everyone knows that the fraction of an irrational number is an infinite non - periodic one. But how can we actually prove this non-periodicity? I tried to contact Google, but did not find an answer. Thank you in advance for your answer.

Taylor series decomposition of a function(Python). Approximate value of the function

It seems that I enter the correct value of the Taylor series expansion of the function, but it does not give the correct valu ... d(f(a),5),end=' ') print(round(f_tochne(a,lich),5)) lich+=1 a+=krok[![введите сюда описание изображения][1]][1]

Predicting SARIMAX statsmodels time series in Python

To predict the time series, I use the SARIMAX model. I build a model, save the calculated coefficients, and try to apply them ... or the forecast. And the original model (see example) for some reason, it requires more than 50 identical values on the tail.

How do I rotate a triangle?

I draw an isosceles triangle in the middle of the screen on Canvas. I draw from the center of the triangle (the intersection ... he rotation are calculated incorrect. What am I doing wrong? How do I calculate the new coordinates after turning a triangle?

Mathematical expressions in Pascal: Abs, Exp, Power

How to write it in pascal? And is it correct: a1 <> (1,78 * (sqr(10) * 10) / c2 + c3 (15,22 b) + (1 / (0,5 y)) exp(x - 1) * (abs(sqr(x)) + power(x, 1 / 3)

Drawing an image rotated in the direction of movement | Graphics | Graphics2D

It is necessary to draw the image rotated in the direction of movement (the rotation should be relative to the center of the ... e to the center and the rotation is incorrect Details: I draw on JPanel in the method paint(Graphics gr) Using Graphics2D

Common divisors (the program does not work)

For a given positive integer n, find the number of integers x lying in the segment [1, n] such that the number of common divi ... ) print() a += 1 In general, the program does not go, if it is not difficult to write the code, please.

the Gaussian method in python 3

I need to complete a task: The Gauss method on python. Actually, I implemented the algorithm itself, there is nothing complic ... myB= input("Введите матрицу правых частей") But it gives the error Not can you tell me how to fix it? Thank you in advance!

The Minimum Prime Divisor problem"

I just started learning Python on the Sirius platform. I was able to solve all the other tasks from the "while" topic, except ... N = int(input()) i = 2 while i*i <= N: if N%i != 0: i += 1 print(i) I can not understand what the error is?

Even Fibonacci numbers. The Euler Project

What is my mistake? I am trying to create a list of all the even Fibonacci numbers, but there are also odd numbers in my list ... mbers ''' for num in numbers: if (num % 2) != 0: numbers.remove(num) print(numbers) filter()

You need to output N pairs of twin primes

I generally understand the question itself, but I can't understand how to implement it in C++. As I understand it: for(N=n; N ... ystem("pause"); return 0; } By the way, it is not working because I did not understand how to implement this or that...

Determine the number of "almost happy" tickets

A ticket number consisting of n digits, where n is even, is called"almost lucky" if the sum of the first n/2 digits in it dif ... two sums, you need to have a difference of one between them and if there is such a ticket,then this ticket is "almost happy".

The inverse of k a modulo m

Reverse number Two integers m and a are given. If there is no inverse number to a modulo m, then print the number -1, and if ... nt, input().split())) b = pow(a[1], a[0] - 2, a[0]) if pow(a[1], a[0] - 2, a[0]) == 0: print(-1) else: print(b)

how to calculate the distance between points on a 2D map if the world is looped (as in civilization)?

Just calculating the distance is not a problem. In my implementation, this is: let distance = Math.sqrt((players[socketId].x ... see each other. How can I make a formula so that they remain visible, taking into account such an organization of the world?

The rotation matrix, why doesn't it work as expected?

There is a rotation matrix In my program it works correctly, rotate the point at a specified angle, but I can't understand w ... riment programmatically, I got the same result: rotation in the opposite direction. Maybe someone knows something about this?