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
Wewaii [24]
3 years ago
15

Suppose that you have just bought a new computer and you want to install soft- ware on that. Specifically, two companies, which

you can think of like Microsoft and Apple, are trying to sell their own copy of n different products, like Opera- tion System. Spread Sheet, Web Browser. For each product i, i c {1,2,...,n}, we have • the price pi > 0 that Microsoft charges and the price p > 0 that Apple charges. • the quality li > 0 of Microsoft version and the quality d > 0 of Apple version For example, Apple may provide a better Web Browser Safari, but Microsoft a better Word Processor. You want to assemble your favorite computer by installing exactly one copy of each of the n products, e.g. you want to buy one operating system, one Web Browser, one Word Processor, etc. However, you don't want to spend too much money on that. Therefore, your goal is to maximize the quality minus total price. However, as you may know, the products of different companies may not be compatible. More concretely, for each product pair (i, j), we will suffer a penalty Tij > 0 if we install product i of Microsoft and product of Apple. Note that Tij may not be equal to Tji just because Apple's Safari does not work well on Microsoft Windows doesn't mean that Microsoft's Edge does not work well in Mac-OS. We assume that products are always compatible internally, which means that there is no penalty for installing two products from the same company. All pairwise penalties will be subtracted from the total quality of the system. Your task is then to give a polynomial-time algorithm for computing which product i to purchase from which of the two companies (Apple and Microsoft) for all i E {1,2,...,n}, to maximize the total system quality (including the penalties) minus the total price. Prove the correctness of your algorithm. (Hint: You may model this problem as a max-flow/min-cut problem by constructing your graph appropriately.)
Computers and Technology
1 answer:
Gennadij [26K]3 years ago
7 0

Answer:

#importing the time module

import time

#welcoming the user

name = raw_input("What is your name? ")

print "Hello, " + name, "Time to play hangman!"

print "

"

#wait for 1 second

time.sleep(1)

print "Start guessing..."

time.sleep(0.5)

#here we set the secret

word = "secret"

#creates an variable with an empty value

guesses = ''

#determine the number of turns

turns = 10

# Create a while loop

#check if the turns are more than zero

while turns > 0:          

   # make a counter that starts with zero

   failed = 0              

   # for every character in secret_word    

   for char in word:      

   # see if the character is in the players guess

       if char in guesses:    

   

       # print then out the character

           print char,    

       else:

   

       # if not found, print a dash

           print "_",      

       

       # and increase the failed counter with one

           failed += 1    

   # if failed is equal to zero

   # print You Won

   if failed == 0:        

       print "

You won"  

   # exit the script

       break              

   print

   # ask the user go guess a character

   guess = raw_input("guess a character:")  

   # set the players guess to guesses

   guesses += guess                    

   # if the guess is not found in the secret word

   if guess not in word:  

 

    # turns counter decreases with 1 (now 9)

       turns -= 1        

 

   # print wrong

       print "Wrong

"    

 

   # how many turns are left

       print "You have", + turns, 'more guesses'  

 

   # if the turns are equal to zero

       if turns == 0:            

   

       # print "You Lose"

           print "You Lose

"  

You might be interested in
What can help prevent issues related to downloading content from the internet
Natasha_Volkova [10]
The best step to take is to have some kind of anti-malware/spyware software. Hope this helps you!


-Belle
8 0
3 years ago
________ is a model of computing in computer processing, storage, software, and other services which are provided as a shared po
Rudiy27

Answer:

"Cloud computing" is the correct answer .

Explanation:

Cloud computing is defined as it provided the resources of the system like data storage etc on the demanding purpose. In cloud computing, it provided the resources without knowing the management. Social media is one of the examples of cloud computing.

  • Cloud computing is a model in the computer system that stores the bulk data provided the services to the user on demands.
  • Cloud computing acts as a shared pool of virtual resources on the internet.
6 0
3 years ago
The basic information in a database program is stored in a table format similar to a:
Ierofanga [76]

Can you add the options?

7 0
3 years ago
Write a function named times_ten. the function should accept an argument and display the product of its argument multiplied time
viva [34]
Since you did not specify a language  i am assuming C

void  x10(int   n){
printf("%d \n",n*10);
return;
}

3 0
4 years ago
Sam’s instructor suggests a top-down programming approach. Which of the following should Sam create in order to follow this sugg
Deffense [45]

Answer:

Modules is the answer

Explanation:

Mark me brainlist?

8 0
3 years ago
Read 2 more answers
Other questions:
  • ​​most code division multiple access (cdma) networks conform to ____________ , created by the telecommunications industry associ
    10·1 answer
  • Write code to simulate the following differential equation for x ranging from 0 to 5. Assume y = 0 when x = 0. Plot y vs. x usin
    11·1 answer
  • What are the 6 external parts of a computer system
    5·1 answer
  • From an audio standpoint, how would a city street rate as a possible film location? great because city streets are interesting t
    15·1 answer
  • Which print setting enables multiple slides to be printed on one page?
    5·2 answers
  • Why would a team choose to employ a zone defense over a person to person defense?
    8·1 answer
  • This software application can be used to organize, analyze, and illustrate data?
    12·2 answers
  • Davids family took him to a hospital as he was suffering from a sericous ailment
    8·1 answer
  • _____ are labels for data, while _____ tie values together into one entity.
    15·1 answer
  • What symbol does access use to the left of a record when it is currently being edited and is therefore locked so that other user
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!