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
Convert (65.125)10 to octal.
grigory [225]

Answer:

101.1

Explanation:

Keep in mind that octal has 8 numbers

Step 1: Split your number in 2 parts (integer part and decimal part):

  • integer part 65
  • decimal part 0.125

Step 2: Convert the decimal part. For this step you need to multiply your decimal part and 8 (8 correspond the octal base) and get the integer part until you need it:

      0.125 * 8 =  1

So your decimal part correspond to number 1 in octal = (1)8

Step 3: Convert integer part: for this step you need to divide your integer part by 8 until you can and get the remainder

      65 / 8 = 8 remainder 1

        8 / 8 = 1 remainder 0

         1 / 8 = 0 remainder 1

Step 4: join the remainders from bottom to top and get the integer part

            101

Step 5: join the integer part and the decimal part to get the octal convertion

              101.1

5 0
3 years ago
Suppose that the first goal in a GP problem is to make 3 X1 + 4 X2 approximately equal to 36. Using the deviational variables d1
Scrat [10]

Answer:

d. d1− = 10, d1+ = 0

Explanation:

Given

3X1 + 4X2 +d1− − d1+ = 36

X1 = 6

X2 = 2

Required

Possible values of d1- and d1+

We have:

3X1 + 4X2 +d1− − d1+ = 36

Substitute values for X1 and X2

3 *6 + 4 * 2 + d1- - d1+ = 36

18 + 8 + d1- - d1+ = 36

Collect like terms

d1- - d1+ = 36 - 18 - 8

d1- - d1+ = 10

For the above equation to be true, the following inequality must be true

d1- > d1+

Hence,

(d) is correct

Because:

10 > 0

3 0
2 years ago
You can merge the cells using the rowspan and colspan attribute of the tag <br> true or false​
Travka [436]

Answer: True.

Explanation: ...

3 0
2 years ago
What does the minimum password age setting control?
Dmitrij [34]
13? 13 is most minimum ages however, I don't understand this question all that well.
3 0
3 years ago
As Alexa types a message, Outlook autosaves the message at various points. In which folder is the message located if Alexa wants
alexgriva [62]

Answer:

Draft

Explanation:

Draft is a specific folder in email that is meant to store partially finished mails and mails which has been created but is not sent .  Draft folders helps in reducing rework on the mail if one is interrupted while writing the mail. Another purpose of draft folder was that if anyone accidentally closes the  mail writing section then the content of mail is not lost and can be easily be obtained in draft folder. It also helps in tracking unsent and unfinished mail for the user.

Since, message written by Alexa is saved at different points but is not sent then if the mail is to be sent, then one needs to look for that mail in Draft folder.

5 0
3 years ago
Read 2 more answers
Other questions:
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    7·1 answer
  • Sahil is making a graphic novel in which the villain plans to reduce the rate at which energy is released from the Sun. The vill
    7·2 answers
  • What aspect of the internet makes it fault-tolerant?
    6·1 answer
  • Suppose two hosts, A and B, are separated by 15,000 kilometers and are connected by a direct link of R = 5 Mbps. Suppose the pro
    11·1 answer
  • What is the output of the following program? #include using namespace std; class TestClass { private: int val; void showVal() {
    5·1 answer
  • To rename a database object, press and hold or right-click the object in the navigation pane and then tap or click ____ on the s
    10·1 answer
  • What is the range of possible sizes for side<br> x?<br> 4.0<br> 2.7
    8·1 answer
  • A well-known production is making a documentary film titled “The Dwindling Population of Grizzly Bears in the United States.” Wh
    5·1 answer
  • Who was the father of computer​
    10·1 answer
  • The _____ describes how data actually moves from an application on one computer to an application on another networked computer.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!