Finding solutions to a set of equations

Assignment Help Business Management
Reference no: EM132255083

This is the question:

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 in 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:

3 2

Use this brute force approach:

xSolution = -99

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
      assign xSolution with x.

Check if xSolution is still -99. If so, then output "No solution".

Ex: If no solution is found, output:

No solution

The answer can be in Python. I am seriously stuck. No clue. Here's what I have.

integer xSolution

integer x

integer y

xSolution = -99

x = Get next input

y = Get next input

while x >= -10 and x <= 10 

  while y >= -10 and y <= 10

   if 8 * x + 7 * y == 38 and 3 * x - 5 * y == -1

     xSolution = x

if xSolution != -99

  Put xSolution to output

  y = Get next input

elseif xSolution == -99

  Put "No solution" to output

Reference no: EM132255083

Questions Cloud

Explore the impact of women leaders in the workplace : Describe the current status of women as leaders in two (2) of the five (5) following situations: management, politics, law, academia, or on boards.
Benefits an enterprise system would bring : You have been hired by Johnson Inc., a small company that imports and distributes an Russian sparkling water. The company is interested
Determine the material price variance : Dynatech Jewelry produced 1,580 rings during March. Determine the material price variance and the material quantity variance for March
Establishing collaborative team environment : Describe three characteristics/behaviors of individual team members that you think are most important for establishing a collaborative team environment.
Finding solutions to a set of equations : Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y = -1
Would this requirement be readily understood by consumer : Would this requirement be readily understood by a consumer who is not familiar with nutritional standards? Why or why not?
At what amount should the gain from the sale of the building : The prevailing rate of interest for a note of this type on January 1, 2017, was 9%. At what amount should the gain from the sale of the building be reported
Understand the role of scripting in network administration : The article in the required reading this week, "Understand the Role of Scripting in Network Administration" by Allen V Rouse
Which international trade theory would best apply : Which international trade theory would best apply and why does BMW (Germany Company) have a production plant near Greenville SC that employs nearly 9000.

Reviews

Write a Review

Business Management Questions & Answers

  Formation requirements for incorporating taxicab business

Mark complied with all formation requirements for incorporating his taxicab business. He is the sole shareholder in the corporation. The corporation owns two automobiles that Mark frequently uses for his own personal use.

  How the effectiveness of the advertising will be measured

Define how the effectiveness of the advertising will be measured. Describe the different promotional strategies that may be used in addition to advertising.

  The dollar change in value during the next year

The current spot exchange rate is S0¥/$ = ¥190/$ and the 1-year forward rate is F1¥/$ = ¥210/$. The prime rate in the United States is 15 percent.

  Determine the ?rm optimal quantity

If market inverse demand is p1(Q1) = a1 - b1Q1 in market 1 and p2(Q2) = a2 - b2Q2 in market 2, and the ?rm produces according to C(Q1, Q2) = cQ1 +dQ1^2 +eQ2, determine the ?rm's optimal quantity, price in each market, and pro?t level. (Assume that..

  Are standards clear and how are they communicated

Are standards clear and how are they communicated? What changes would you recommend? What does support look like/mean in your organization?

  Resource allocation and attaining business objectives

What is the most significant factor in the relationship between resource allocation and attaining business objectives? Explain.

  A background paragraph that includes factual and historical

analytical essay report about polio1?- an introductory paragraph2 - a background paragraph that includes factual and

  Context of seeking export opportunities

In the context of seeking export opportunities, which of the following is true of large firms?

  Discuss the pros and cons of mcdonnells position as

discuss the pros and cons of mcdonnells position as expressed by the vp.when a mcdonnell douglas dc-10 crashed over

  Monopolistically competitive markets monopolistic

In what ways are monopolistically competitive markets "monopolistic?" In what ways are they "competitive?"

  Perimeter of the triangle with the vertices

Find the perimeter of the triangle with the vertices at (1, -1), (-3, 3), and (-3, -3). Show work please.

  Human resources director at matrix

Your supervisor, Annalise, the Human Resources Director at Matrix, has reviewed your research on performance appraisal feedback and is very impressed with your work.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd