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
vovikov84 [41]
3 years ago
9

A group of n Ghostbusters is battling n ghosts. Each Ghostbuster carries a proton pack, which shoots a stream at a ghost, eradic

ating it. A stream goes in a straight line and terminates when it hits the ghost. The Ghostbusters decide upon the following strategy. They will pair off with the ghosts, forming n Ghostbuster-ghost pairs, and then simultaneously each Ghostbuster will shoot a stream at his chosen ghost. As we all know, it is very dangerous to let streams cross, and so the Ghostbusters must choose pairings for which no streams will cross. Assume that the position of each Ghostbuster and each ghost is a fixed point in the plane and that no three positions are collinear.Give an O(n 2 lg n)-time algorithm to pair Ghostbusters with ghosts in such a way that no streams cross. Provide a step by step algorithm for this question.
Engineering
1 answer:
babunello [35]3 years ago
4 0

Answer:

Using the above algorithm matches one pair of Ghostbuster and Ghost. On  each side of the line formed by the pairing, the number of Ghostbusters and Ghosts are  the same, so use the algorithm recursively on each side of the line to find pairings. The  worst case is when, after each iteration, one side of the line contains no Ghostbusters  or Ghosts. Then, we need n/2 total iterations to find pairings, giving us an P(n^{2} lg n)-  time algorithm.

You might be interested in
HELP PLEASE!!!!
DaniilM [7]

Answer:

DESCULPA MAS EU NÃO ENTENDI

8 0
2 years ago
A slender rod AB, of weight W, is attached to blocks A and B, which move freely in the guides shown. The blocks are connected by
gregori [183]

Answer:

(a) T = W/2(1-tanθ)  (b) 39.81°

Explanation:

(a) The equation for tension (T) can be derived by considering the summation of moment in the clockwise direction. Thus:

Summation of moment in clockwise direction is equivalent to zero. Therefore,

T*l*(sinθ) + W*(l/2)*cosθ - T*l*cosθ = 0

T*l*(cosθ - sinθ) = W*(l/2)*cosθ

T = W*cosθ/2(cosθ - sinθ)

Dividing both the numerator and denominator by cosθ, we have:

T = [W*cosθ/cosθ]/2[(cosθ - sinθ)/cosθ] = W/2(1-tanθ)

(b) If T = 3W, then:

3W = W/2(1-tanθ),

Further simplification and rearrangement lead to:

1 - tanθ = 1/6

tanθ = 1 - (1/6) = 5/6

θ = tan^(-1) 5/6 = 39.81°

8 0
2 years ago
Anything that is made to meet a need or desire is?
slavikrds [6]

Answer:

I think it is process or technology

7 0
2 years ago
Read 2 more answers
Which claim does president Kennedy make in speech university rice ?
mafiozo [28]

Answer:  The United States must lead the space race to prevent future wars.

Explanation: Hope this helps

4 0
2 years ago
Read 2 more answers
C++ - Green Crud Fibonacci programThe following program is to be written with a loop. You are to write this program three times
Fynjy0 [20]

Answer:

Below is the required code:

Explanation:

Using for loop

#include <iostream>

using namespace std;

int main()

{

    //Initial crud size

    int init = 0;

    int newCrud;

    int next=0;

    //Number of days to simulate

    int no_days;

    int day;

    cout << "Enter initial amount of green crud: ";

    cin >> newCrud;

    cout << "Enter number of days to simulate: ";

    cin >> no_days;

    for (day = 10; day<=no_days; day++)

    {

         if (day % 10 == 0)

         {

             next = newCrud + init;

         }

             newCrud = init;

             init = next;

    }

    if (no_days < 5)

    cout << "\nCrud reproduce only after 5 days minimum.Hence the current amount is "

    << newCrud << " pounds.";

    else

    cout << "On day " << no_days << " you have " << init

    << " pounds of green crud." << endl;

    cout << "\nWould you like to continue? (y or n): ";

    cin >> ans;

         return 0;

}

Output:

         Enter initial amount of green crud: 5

         Enter number of days to simulate: 220

    On day 220 you have 10485760 pounds of green crud.

Using while loop

Program:

#include <iostream>

using namespace std;

int main()

{

    char ans='y';

    while (ans == 'Y' || ans == 'y')

    {

         //Initial crud size

         int init = 0;

         int newCrud;

         int next=0;

         //Number of days to simulate

         int no_days;

         int day;

         cout << "Enter initial amount of green crud:

         ";

         cin >> newCrud;

         cout << "Enter number of days to simulate:

         ";

         cin >> no_days;

         for (day = 10; day<=no_days; day++)

         {

             if (day % 10 == 0)

             {

                  next = newCrud + init;

             }

                  newCrud = init;

                  init = next;

         }

         if (no_days < 5)

         cout << "\nCrud reproduce only after 5 days

         minimum.Hence the current amount is "

         << newCrud << " pounds.";

         else

         cout << "On day " << no_days << " you have "

         << init

         << " pounds of green crud." << endl;

         cout << "\nWould you like to continue? (y or

         n): ";

         cin >> ans;

    }

    return 0;

}

Output:

Enter initial amount of green crud: 5

Enter number of days to simulate: 220

On day 220 you have 10485760 pounds of green crud.

Would you like to continue? (y or n): y

Enter initial amount of green crud: 5

Enter number of days to simulate: 225

On day 225 you have 10485760 pounds of green crud.

Using do while loop

Program:

#include <iostream>

using namespace std;

int main()

{

    char ans;

    do

    {

         //Initial crud size

         int init = 0;

         int newCrud;

         int next=0;

         //Number of days to simulate

         int no_days;

         int day;

         cout << "Enter initial amount of green crud: ";

         cin >> newCrud;

         cout << "Enter number of days to simulate: ";

         cin >> no_days;

         for (day = 10; day<=no_days; day++)

         {

             if (day % 10 == 0)

             {

                  next = newCrud + init;

             }

                  newCrud = init;

                  init = next;

         }

         if (no_days < 5)

         cout << "\nCrud reproduce only after 5 days

         minimum.Hence the current amount is "

         << newCrud << " pounds.";

         else

         

         cout << "On day " << no_days << " you have " <<

         init << " pounds of green crud." << endl;

         cout << "\nWould you like to continue? (y or n):

         ";

         cin >> ans;

    } while (ans == 'Y' || ans == 'y');

    return 0;

}

Output:

Enter initial amount of green crud: 5

Enter number of days to simulate: 220

On day 220 you have 10485760 pounds of green crud.

Would you like to continue? (y or n): y

Enter initial amount of green crud: 5

Enter number of days to simulate: 225

On day 225 you have 10485760 pounds of green crud.

7 0
3 years ago
Other questions:
  • When using levers like scissors or hedge clippers, what can be done to increase the cutting force so that you don’t have to sque
    5·1 answer
  • A 12-mm-diameter cylindrical jet of water discharges vertically into the ambient air. Due to surface tension the pressure inside
    14·1 answer
  • A fuel cell vehicle draws 50 kW of power at 70 mph and is 40% efficient at rated power. You are asked to size the fuel cell syst
    15·1 answer
  • Briefly explain why small-angle grain boundaries are not as effective in interfering with the slip process as are high-angle gra
    5·1 answer
  • Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of Chapter 7 . The program should display a list of
    15·1 answer
  • Helium gas expands in a piston-cylinder in a polytropic process with n=1.67. Is the work positive, negative or zero?
    8·1 answer
  • Which type of load generates a magnetic field?
    12·1 answer
  • The wave-particle duality theory is the first adequate explanation of which one of the following observations about the hydrogen
    10·1 answer
  • 1. You should
    11·2 answers
  • s) Use Cramer’s rule to solve the system below, and state the condition at which solution exists. ax+by = 1 cx+dy =−1
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!