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
MrRissso [65]
3 years ago
13

There are 22 gloves in a drawer: 5 pairs of red gloves, 4 pairs of yellow, and 2 pairs of green. You select the gloves in the da

rk and can check them only after a selection has been made. What is the smallest number of gloves you need to select to have at least one matching pair in the best case?
Engineering
1 answer:
antiseptic1488 [7]3 years ago
3 0

Answer:

Best case = 2 gloves

Given Information:

Red gloves = 5 pairs

Yellow gloves = 4 pairs

Green gloves = 2 pairs

smallest number of gloves you need to select to have at least one matching pair in the best case = ?

Explanation:

How many gloves do you need to make one matching pair?

2

Yes, you are right. 2 gloves makes a matching pair and it is the smallest number of gloves you need to select to have at least one matching pair.

But what about worst case?

lets say

you tried all 5 red gloves either all of them were left or right

then you tried 4 yellow gloves either all of them were left or right

then you tried 2 green gloves either all of them were left or right

Now all the left or right gloves are tried (5 + 4 + 2 = 11) and the 12th one will definitely be either matching red, yellow or green.

Therefore, in the worst case scenario, the smallest number of gloves you need to select to have at least one matching pair is 12.

You might be interested in
What is definition of<br>computational fluid Dynamics <br>unstructured grid <br>domain<br>geometry​
Keith_Richards [23]
Najsjjsjhshehdhdhdhdhhdhdhdhdhhd
6 0
3 years ago
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
Briefly explain how a jet moves
sergejj [24]

Answer:

Jet engines move the airplane forward with a great force that is produced by a tremendous thrust and causes the plane to fly very fast. All jet engines, which are also called gas turbines, work on the same principle. The engine sucks air in at the front with a fan. ... Spinning the turbine causes the compressor to spin.

Explanation:

yw

8 0
3 years ago
Cavitation usually occurs because:
IgorLugansk [536]

Answer:

B) the liquid accelerated to high velocities.

<em>I</em><em> </em><em>hope</em><em> </em><em>this helps</em><em> </em>

3 0
3 years ago
You hang a heavy ball with a mass of 42 kg from a silver rod 2.7 m long by 1.9 mm by 2.6 mm. You measure the stretch of the rod,
nadezda [96]

Answer:

Explanation:

cross sectional area  A = 1.9 x 2.6 x 10⁻⁶ m²

= 4.94 x 10⁻⁶ m²

stress = 42 x 9.8 / 4.94 x 10⁻⁶

= 83.32 x 10⁶ N/m²

strain = .002902 / 2.7

= 1.075 x 10⁻³

Young's modulus = stress / strain

= 83.32 x 10⁶ / 1.075 x 10⁻³

= 77.5 x 10⁹ N/m²

5 0
3 years ago
Other questions:
  • Write a C++ program to display yearly calendar. You need to use the array defined below in your program. // the first number is
    13·1 answer
  • Consider a process in which a carbon-based fuel is combusted in the presence of 70% excess oxygen (assume that all of the oxygen
    10·1 answer
  • Different Gauss quadrature formulae predict different values for the same integral a. True b. False
    11·1 answer
  • An undeformed specimen of some alloy has an average grain diameter of 0.050 mm. You are asked to reduce its average grain diamet
    11·1 answer
  • Which of the followong parts does not rotate during starter operation? A. Commutator segments B. Armature windings c. Field wind
    10·1 answer
  • Four subjects civil engineers need to study​
    12·1 answer
  • Which of the following addresses future implications of design and process decisions?
    5·1 answer
  • Technician A says when the brakes are applied in a vacuum booster, the vacuum control valve is closed. Technician B says the vac
    7·1 answer
  • What is one of the most common ways in which workers get hurt around machines?
    14·1 answer
  • To meet the needs of a client, what is best for an interior designer to do?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!