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
Twitter, Foursquare, and other real-time media add to or leverage capabilities of smartphones--improving your ability to be well
Sati [7]

Answer: True

Explanation: Twitter is the application that functions online for providing news and communication for connecting people on social network.Foursquare is also an online app that works on the social platform in the smartphones and provide the knowledge about activity of people moving through the real-time world.

Other real world apps that operate in the real time helps in providing information about the activities and incidents happening through the smartphones.This also increases the knowledge of the individual by discovering, reading,sharing of the information.Thus the statement given is true.

7 0
4 years ago
What is data and instructions entered into the memory of a device
lyudmila [28]

A POINTING DEVICE IS AN INPUT DEVICE THAT ALLOWS A USER TO CONTROL A POINTER ON THE SCREEN. ... A KEYBOARD IS AN INPUT DEVICE THAT CONTAINS KEYS USER TO ENTER DATA AND INSTRUCTIONS INTO A COMPUTER.                                                                            

SORRY FOR CAPS MY CAPS KEY GOT STUCK

3 0
4 years ago
What is LATEX ? <br>create a latex command
AVprozaik [17]

Latex is a software used for writing daily life issue like integrations,fractions ,limits .

Lets see an example

\\ \bull\tt\longmapsto \displaystyle{\int}vdx

\\ \bull\tt\longmapsto \displaystyle{\lim_{x\to 0}}

5 0
3 years ago
How can you best explain server side caching with web pages​
maksim [4K]

Answer:

Server side web caching typically involves utilizing a web proxy which retains web responses from the web servers it sits in front of, effectively reducing their load and latency.

Explanation:

4 0
3 years ago
What term specifies how information systems resources should be used and how they should work together?
jarptica [38.1K]

Answer:

b.Information systems architecture

Explanation:

Information System Architecture defines a system in terms of its resources and how they interact with each other. Some aspects of the Information System Architecture include the data that is managed by the system and the architecture of the application software. Another aspect is configuration, which involves the hardware architecture of the system. The organization of the system takes a look at the maintenance of the system while the communication aspect architecture looks at the networks that link the different resources e.g topology diagrams.

6 0
3 years ago
Other questions:
  • In order to accomplish the same goal, a person can click and hold down the mouse button and drag to the right, or hold Shift and
    5·2 answers
  • The cmos memory located on the motherboard is often referred to as _____ memory because of its capability to store bios settings
    9·1 answer
  • Consider the classes below: public class TestA { public static void main(String[] args) { int x = 2; int y = 20 int counter = 0;
    8·1 answer
  • Anyone can give me the definition of specification ?
    10·2 answers
  • Every presentation should have a beginning, a middle, and an end.
    10·1 answer
  • Anyone else 17 and still plays rblox xd?
    8·2 answers
  • Guys how can i video my self from my laptop <br> my laptop is (lenovo)
    8·2 answers
  • Jose has 3/5 kilogram of peppermints and 2/3 kilogram of candy canes. How many kilograms of candy does he have?
    10·1 answer
  • 4.8 code practice question 1 edhesive
    8·2 answers
  • Make a list of any four computer that were used in the history of computer.​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!