1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Pavel [41]
2 years ago
15

Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y =

-1 have a solution x = 3, y = 2. Given integer coefficients of two linear equations with variables x and y, use brute force to find an integer solution for x and y in the range -10 to 10.
Ex: If the input is:

8
7
38
3
-5
-1
Then the output is:

x = 3 , y = 2
Use this brute force approach:

For every value of x from -10 to 10
For every value of y from -10 to 10
Check if the current x and y satisfy both equations. If so, output the solution, and finish.
Ex: If no solution is found, output:

There is no solution
Assume the two input equations have no more than one solution.

Note: Elegant mathematical techniques exist to solve such linear equations. However, for other kinds of equations or situations, brute force can be handy.
Computers and Technology
1 answer:
Gre4nikov [31]2 years ago
4 0

The brute strength method determines if each x and y value satisfies both conditions. To do this, we must iterate through each result in the specified range and insert them into both models.

<h3>What are Elegant mathematical technique?</h3>

ALGORITHM :

1. Take the values of all coefficients and SET flag = FALSE

2. Run a FOR loop for x in range (-10, 11). 11 won't be included.

2a. Inside the first FOR, start the y FOR loop in range(-10,11). 11 won't be included

2b. Inside the y FOR loop, check IF for a particular value of x and y both the equations satisfied.

2c. If yes, set flag TRUE and print values of x and y.

2d. ELSE the flag stays FALSE.

END FOR Y

END FOR X

3. Check if flag = FALSE, then print NO SOLUTION

PYTHON CODE :

a=int(input()) #taking input for each coefficient

b=int(input())

c= int(input())

a1= int(input())

b1= int(input())

c1= int(input())

flag = False

for x in range(-10,11): #checking for all values of x in range -10 to 10

for y in range(-10,11): #checking for all values of x in range -10 to 10

if (a  x + b  y – c == 0) and (a1*x + b1*y - c1 == 0) : #checking if the x and y values satisfy the equation

flag = True #setting the flag if solution is found

print('Solution : x = {-10, 10}, y = {-10, 10}'.format(x,y)) #if they satisfy print x & y

if flag = False : #if flag stays false, that means there is no solution

print('No solution')

OUTPUT : The output is given below.

More about the Elegant mathematical technique link is given below.

brainly.com/question/27934739

#SPJ1

You might be interested in
To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are begi
almond37 [142]

Question:

To mitigate the effects of most of the common network threats including disruption, destruction and disaster, companies are beginning to migrate their servers, networking devices and data into professional datacenters. This is called

A) Colocation

B) SAAS

C) Peering

D) Clustering

E) Server Farming

Answer:

The correct answer is A) Colocation

Explanation:

Colocation as already defined is the voluntary relocation of all network facilities to a data centre so as to reduce the risks of disaster, disruption, destruction, intrusion whilst increasing security, flexibility and scalability at a lower cost.

As the world gets more digitized, datacentres are getting more patronage. The sales figures show this.

Cheers!

6 0
2 years ago
C++ Question: what is in the blanks?
Igoryamba

You didn't specify what the program should output, so there are many possibilities that result in a working program. It *looks* like this was intended:

int x = 24;

int y;

y = x-12;

cout<<y<<endl;

and it will display 12.

8 0
3 years ago
Which technology can be used as a defense against dos and ddos syn flood attacks?
Montano1993 [528]
In terms of websites, there's a service called cloud flare which can prevent DDOS attacks in websites. Other applications you would have to look up. Hopefully this helps!
6 0
3 years ago
Write three tasks students can preform in a digital classroom?
Nadya [2.5K]

Students can perform several tasks in a digital environment. For example, they can watch instructional videos, take notes, and participate in peer discussions.

this is the right answer .just did it

7 0
3 years ago
Read 2 more answers
What feature allows you to access previous copies of a document on OneDrive?
swat32
<span>C) Stored work

I hope this helps :)
</span>
4 0
3 years ago
Read 2 more answers
Other questions:
  • In fiberoptic cable, the signal source is__________waves
    7·1 answer
  • Switches operate on what layer of the OSI Model
    11·1 answer
  • Desktop computer systems are less reliable than laptop computers. <br> a. True <br> b. False
    9·1 answer
  • Baking Cookies. Sweet Dough Inc. bakes cookies—a popular dessert—based on the quantities ordered by their customers. Three raw m
    12·1 answer
  • (BRAINLIEST QUESTION!!!)
    11·1 answer
  • ____________________ is the primary code humans use to communicate. (Points : 1
    9·1 answer
  • Im boing exam help please In a category-based course grading system, teachers weigh a student's performance in all courses. all
    7·2 answers
  • Free coins who is octane and dont say u dont know because i will do the same to u
    13·2 answers
  • What are the pros and cons of being a single decision maker
    8·1 answer
  • write an algorithm to settle the following question: a bank account starts out with $10,000. interest is compounded monthly at 6
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!