You are a contractor working for company C. This company builds computer chips, and it needs to buy a lot of silicon, wh
Posted: Thu Jul 14, 2022 2:27 pm
Link to Q 2:
https://www.answers.com/homework-help/que ... q100174943
You are a contractor working for company C. This company builds computer chips, and it needs to buy a lot of silicon, which is the main material used to fabricate these chips. Your work, as a contractor, is to buy the amount of silicon needed (in kg ) from other companies, and sell it to company C. However, and since the pandemic started, the price of silicon has been very volatile. So, your task is to determine the max commission you can get from selling (x)kg of silicon to company C considering that several companies are selling silicon it at a different price per kg. For example: given two lists S=[a,b,c,d], and P=[$20,$90,$50,$30] where S represents a list of companies (subcontractors) selling silicon, and P the list of prices per (k) kilograms of silicon offered from these companies, where k=(i+1), and i represents the index of every price in P. Your goal is to find the maximum profit for selling 3 kg of silicon to company C if it is guarantied that you'll get a commission of 20% from this profit From the data given in this problem we can infer that: - Subcontractor company a offers 1 kg of silicon at a price of $20 - Subcontractor company b offers 2 kg of silicon at a price of $90 - Subcontractor company c offers 3 kg of silicon at a price of $50 - Subcontractor company d offers 4 kg of silicon at a price of $30 So, using the above offers from all the subcontractors, you (the contractor) can compute the maximum profit of selling 3 kg of silicon to company C using the following logic:
1. You buy 3 kg of silicon from company "c" at a total price of $50 2. You buy 1 kg of silicon from company "a" and 2 kg of silicon from company "b" at a total price of $20+$90=$110 3. You buy 1 kg+1 kg+1 kg of silicon from company "a" at a total price of $20+$20+$20= $60 4. You buy 3 kg out of 4 kg of silicon from company "d" at a total price of 4kg3kg($30)=$22.5 Therefore, from all the transactions, the one that provides the maximum profit is transaction (2) where you can buy 3 kg of silicon for $110. Once the silicon you got is sold to company C for the same price you bought it, and after 20% of commission is applied, you'll get a profit of $22 for this transaction
3. (1.75 points) Based on your pseudocode from part 2, compute the complexity and the Big O (worst case) time complexity of your algorithm. Show all your work to get credit for this problem.
https://www.answers.com/homework-help/que ... q100174943
You are a contractor working for company C. This company builds computer chips, and it needs to buy a lot of silicon, which is the main material used to fabricate these chips. Your work, as a contractor, is to buy the amount of silicon needed (in kg ) from other companies, and sell it to company C. However, and since the pandemic started, the price of silicon has been very volatile. So, your task is to determine the max commission you can get from selling (x)kg of silicon to company C considering that several companies are selling silicon it at a different price per kg. For example: given two lists S=[a,b,c,d], and P=[$20,$90,$50,$30] where S represents a list of companies (subcontractors) selling silicon, and P the list of prices per (k) kilograms of silicon offered from these companies, where k=(i+1), and i represents the index of every price in P. Your goal is to find the maximum profit for selling 3 kg of silicon to company C if it is guarantied that you'll get a commission of 20% from this profit From the data given in this problem we can infer that: - Subcontractor company a offers 1 kg of silicon at a price of $20 - Subcontractor company b offers 2 kg of silicon at a price of $90 - Subcontractor company c offers 3 kg of silicon at a price of $50 - Subcontractor company d offers 4 kg of silicon at a price of $30 So, using the above offers from all the subcontractors, you (the contractor) can compute the maximum profit of selling 3 kg of silicon to company C using the following logic:
1. You buy 3 kg of silicon from company "c" at a total price of $50 2. You buy 1 kg of silicon from company "a" and 2 kg of silicon from company "b" at a total price of $20+$90=$110 3. You buy 1 kg+1 kg+1 kg of silicon from company "a" at a total price of $20+$20+$20= $60 4. You buy 3 kg out of 4 kg of silicon from company "d" at a total price of 4kg3kg($30)=$22.5 Therefore, from all the transactions, the one that provides the maximum profit is transaction (2) where you can buy 3 kg of silicon for $110. Once the silicon you got is sold to company C for the same price you bought it, and after 20% of commission is applied, you'll get a profit of $22 for this transaction
3. (1.75 points) Based on your pseudocode from part 2, compute the complexity and the Big O (worst case) time complexity of your algorithm. Show all your work to get credit for this problem.