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
) Consider a router that interconnects four subnets: Subnet 1, Subnet 2, Subnet 3 and Subnet 4. Suppose all of the interfaces in
erik [133]

Answer:

Check the explanation

Explanation:

223.1.17/24 indicates that out of 32-bits of IP address 24 bits have been assigned as subnet part and 8 bits for host id.

The binary representation of 223.1.17 is 11011111 00000001 00010001 00000000

Given that, subnet 1 has 63 interfaces. To represent 63 interfaces, we need 6 bits (64 = 26)

So its addresses can be from 223.1.17.0/26 to 223.1.17.62/26

Subnet 2 has 95 interfaces. 95 interfaces can be accommodated using 7 bits up to 127 host addresses can represented using 7 bits (127 = 27)

and hence, the addresses may be from 223.1.17.63/25 to 223.1.17.157/25

Subnet 3 has 16 interfaces. 4 bits are needed for 16 interfaces (16 = 24)

So the network addresses may range from 223.1.17.158/28 to 223.1.17.173/28

4 0
3 years ago
What is one important feature of an AUP?
rusak2 [61]

Answer:

A clear outline of the consequences of violating the policy  is the correct answer to this question.

Explanation:

AUPs are used by schools and universities, corporations, businesses, internet and hosting service providers, and website owners. An acceptable use of policy in AUP helps in many ways:

  • Online platforms and applications require users to sign the policy before granting access to any information database, online shop, or other networks.
  • An acceptable use policy helps in reducing risk when it comes to online safety, decreased productivity, and damage to both the company and the users.
  • One of the main reasons why an acceptable use policy is important is to ensure the safety of users.
  • Use of policy is also known as fair use policy.It is set of rules applied by the owner of the network or website.
8 0
3 years ago
Greg is writing a report on becoming an advertising and promotions manager. Complete the report by correctly filling in the miss
zzz [600]

Since Greg wants to become an advertising and promotions manager, he needs to at least gain a (B) bachelor’s degree level of education, since generally, this educational background is expected from individuals who wishes to work in an entry-level position in the field of advertising.

One of the skills that he also needs to develop is (C) communication skills, because he would have to be able to communicate in both written and spoken to develop the advertisements according to the client’s desires.

8 0
3 years ago
Write 'T' for true and 'F' for false statements.
asambeis [7]
1-F
2-T
3-F
4-F
5-F
6 T
7-T
3 0
2 years ago
3. Write a method squareOfAsterisks that displays a solid square (the same number of rows and columns) of asterisks whose side i
iren2701 [21]

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void squareOfAsterisks(int x) //defining method squareOfAsterisks

{

   int i,j; //defining integer variable

   for(i=1;i<=x;i++) //defining loop to print column value

   {

   for(j=1;j<=x;j++) //defining loop to print row value

   {

   cout<<"*"; //print value

   }

   cout<<endl; //for line break

   }

}

int main() //defining main method

{

int x; //defining integer variable

cout<<"Enter any number: "; //print message

cin>>x; //input value from user

squareOfAsterisks(x); //calling the method and pass the value

return 0;

}

Output:

Enter any number: 4

****

****

****

****

Explanation:

The description of the above program can be given as follows:

  • In the given program a method "squareOfAsterisks" is declared, that accepts an integer value "x" in its arguments, inside the method two integer variable I, j is used, that uses a to print the given pattern.
  • In the main method, an integer variable x is declared, which takes input from the user end, and then calls the method, that is "squareOfAsterisks" and passes its value.
8 0
2 years ago
Other questions:
  • How do type declaration statements for simple variables affect the readability of a language, considering that some languages do
    10·1 answer
  • Spreadshet formula to add totals​
    12·1 answer
  • Keisha has been asked to give a presentation about a new method for processing customer returns. The first thing she should do i
    11·1 answer
  • How many questions must you answer in Brainly to be able to message people?
    6·2 answers
  • What is output when the CarTest application is run? Why?
    11·1 answer
  • HELP PLEASE
    7·1 answer
  • 5. A Disk defragmenter tool does what to a computer HDD?
    6·1 answer
  • In the previous project, you are storing the first name of the gamer. Write a phrase to the game right before the first word wit
    6·1 answer
  • Neview of related literature happens in two wayo (1) Traditional and
    6·1 answer
  • Blockquote
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!