matemática

How to identify an invalid graph for machine operator allocation problem?

I was recently answering a question ( machine scaling-Graph Theory ), but there was an open problem that I could not solve: ... id exactly with this question of giving the intersections determine whether or not it is valid on the mathematics exchange

How to generate 200,000 primes as fast as possible in Python?

Attention: I'm not looking for ready-made pieces of code. I just want someone to help me think of some way to generate ... ge(len(indexes)): result.append(str(arrayPrimos[indexes[m]-1])) print('\n--- R E S U L T A D O ---\n'+' '.join(result))

Almost prime numbers

I have a doubt in C, I know to check if a number is prime, however, almost prime I do not know.. how do I do it? Follows th ... e um numero primo!\n", num); } } else if (num == 1 ) printf("O numero nao é primo e nem quase primo!"); }

What is the difference between logical implication and logical equivalence?

I am studying mathematical logic and programming logic, and I would like to know what is the difference between logical implication and logical equivalence?

Calculation of weighted moving average with exponential adjustment

How could I calculate a in the following formula in java: I did the following: Df = Df + a(1 -a) xx i I generalized the ... searched in English websites on google with the following search : "exponential smoothing formula" but I did not get success.

Algorithm factorization in C

I need to create a program in C, which factors any number the user enters. I wrote this code, but it doesn't fully work as it ... printf("%i |%i=%i", num, i, resp); } } if(resp==1) break; } return 0; }

How to make an MDC algorithm with only sum and subtraction?

How do I make an algorithm that calculates the MDC of two numbers using only addition and subtraction operations? It is forbidden to use operators other than those requested.

How to detect what are the common points between two circumferences?

I need help for the following Program: Receive from the keyboard the equations of two circles: c1= X^2+y^2+ax+by+c=0 c2= ... dent, I do not understand almost anything about programming (it is not my area), given that if someone can give me a "light".

How to make and calculate the frequency distribution table in R?

I am trying to make the frequency distribution Table in R, however, I am not succeeding, due to some formulas and calculati ... 19 19 19 19 20 20 22 23 24 26 26 30 32 Question How can I make the frequency distribution table of this data up on the R?

Why multiplication is faster than division?

Bit brushing question, but I was reading an article on javascript where it says division is slower than doing multiplications ... e article I mentioned in Section Math : http://jessefreeman.com/game-dev/intro-to-programming-for-games-with-javascript /

Minimum amount of bits required to represent decimal numbers

I'm doing a list of computer architecture and one of the first exercises is pretty basic: What is the minimum amount of bit ... her teaching this in class. Is there really any other way? I don't need the answer of the exercise, just the way to solve it.

Calculate the divisors of a number in Python performatically

The code I am using is: import time def divisores(num): for i in range(1, int(num/2+1)): if num % i == 0: ... ução: 5.94 segundos. This code is slow. Is there a more performatic way to calculate the divisors of a number using Python?

How to identify "capicua" numbers that have 5 digits?

According to this definition of priberam.pt , a capicua number is: Number that reads equally from right to left or vice ... 5 identical digits like 55555, 33333, 00000, etc? P.S.: no matter the language, only the logic to develop a way to solve it.

How to calculate Euclidean distance

I want to calculate the Euclidean distance by the following Formula: So I tried, doing this Code: #define SLEEP_1 1000 ... xample: √(4-7) ² + (2-5) ² = 12 But the program says: √(4-7) ² + (2-5) ² = -214(...) Is there any other way to do this?

Sine calculation with Python

Hello, I have a problem in the calculation of sine using the pyhton, I set up a function for the calculation of Sine and cosi ... t; 50): cont += 1 resultado += (((-1)**cont)*(numero**(2 * cont)))/(fatorial(2 * cont)) return resultado

What is the difference between one-dimensional and two-dimensional matrix?

In high school we usually study on the concept of Matrix, which consists of a row table and columns forming a set of numbers ... -dimensional and a two-dimensional array? I would like examples in some languages, e.g. java , php, c++ se possible.

Doubt with sum of flagged binaries

I am studying operations with binary numbers signaled and I have a question that I would like you to clarify: When adding t ... t to know is if this addition of the 0 in front is considered overflow (since it bursts the 6 bits) or does it matter at all?

Incorrect value in binary number subtraction using strings

I made this code and it basically gets two numbers in binaries (no separation of spaces between bits), and performs (at least ... == '1'){ res[i+1] = '0'; } res[0] = '0'; } cout<< "res : " << res<< endl; return 0; }

C++ - sort privately points of a rectangle in a vector?

I have a project in c++ where I should map regions of an image using the mouse click. The question is Should I get the mappin ... s not work for all cases. Would anyone know how to help me with this problem, if there is any solution? I appreciate it now.

How do you know if a point (x, y)is within the filled percentage of a pie chart?

I came up with this code that shows if a point (x, y) is inside or outside a circle in a Cartesian plane. def dentro_fora(p, ... he point (12, 55) is inside the filled area? Whereas the center of the circle is the point (50, 50) and the radius is 50.