Questions
Question 5 The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each...

Question 5

The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue.

Process          Burst Time      Arrival Time   Priority

P1                15            0            8

P2                20           0            3

P3                20           20           4

P4                20           25           4

P5                5            45           5

P6                15            55           5

What is the average turnaround time of these processes?

Answer:

Question 6

The following processes are being scheduled using a preemptive, priority-based, round-robin scheduling algorithm. Each process is assigned a numerical priority,with a higher number indicating a higher relative priority. The scheduler will execute the highest-priority process. For processes with the same priority, a round-robin scheduler will be used with a time quantum of 10 units. If a process is preempted by a higher-priority process, the preempted process is placed at the end of the queue.

Process          Burst Time      Arrival Time   Priority

P1                15            0            8

P2                20           0            3

P3                20           20           4

P4                20           25           4

P5                5            45           5

P6                15            55           5

What is the average waiting time of these processes?

Answer:

In: Computer Science

write a java code to represent a sales class as follows: 1- The Sales class contains...

write a java code to represent a sales class as follows:

1- The Sales class contains the names of sellers (strings) and the sales/seller/day (matrix of integers). Assume the number of sellers is set dynamically by the constructor and that the sellers work 6 days/week.

Example:

names/days 0 1 2 3 4 5
Ali 30 5 89 71 90 9
Ahmad 15 81 51 69 78 25
Omar 85 96 7 87 41 54

The class should contain the following methods:

- setSaleDetails, this method takes two arguments: the array of sellers' names and their detailed sales as a matrix of integers.

- printSalesDetails. This method prints the sellers' names and their sales (as in the example)

- printTotalSalesPerSeller. This method prints the list of total sales for each seller during the week

- getBestSeller . This method prints the name of the seller who achieved the highest sales during the whole week.

- getBestSellerAtDay . This method takes an integer Day as an argument (from 0 - 5). and prints the name of the seller who achieved the highest sales at this specific day.

----- You are asked to implement a tester class called SalesTester which has the main and do the following:

- creates an object from class Sales with a specific number of sales (example: 3)

- generates a random set of sales for each seller. Assume sales/day is integer and between 0 and 100.

- set the names of sellers and their sales (pass it to created object)

- calls all the methods of the class Sales for testing.

In: Computer Science

At carnivals and entertainment parks, there is a popular game of horse-racing. Each player has a...

At carnivals and entertainment parks, there is a popular game of horse-racing. Each player has a movable horse on the display whose number corresponds to his or her alley number. The game consists of rolling a ball up an alley, where it can land in one of 15 holes. The holes are colored according to the graphic in the margin. If your ball lands in a red hole, your horse advances one space. If it lands in yellow, your horse advances two spaces, and if it lands in green, your horse gallops ahead three spaces. After your ball goes in the hole, it returns to you for your next roll. The first horse that moves 12 spaces is the winner, and the jockey, the person rolling the ball, receives a stuffed animal as a prize. One customer is at the game, bragging that he always wins after eight rolls. You look over the game and estimate that you have a 40% chance of getting the ball in a red hole, a 30% chance of getting it in a yellow hole, and a 20% chance of getting it in a green hole. There is also a 10% chance that you miss the holes, and your ball returns to you without advancing the horse. Based on your estimates of the probabilities, is it worthwhile to play the game against the bragging customer? What is the chance you will win by the eighth roll? EXCEL SHEET formulas!

In: Statistics and Probability

Read the article titled “What Is the Importance of Probability Rules in a Business?” listed below....

Read the article titled “What Is the Importance of Probability Rules in a Business?” listed below.

__________________________________________________________________________

What Is the Importance of Probability Rules in a Business?

by Kevin Johnston

Probability has a popular meaning that is not the same as the mathematical meaning. As a small-business owner, you may act on hunches, guesses and instincts. After such actions, you might even say you thought a certain outcome was "probable." However, the mathematics of probability has rules that you can use in a much more disciplined way than guesswork to predict possible outcomes for your business plans.

Classical Approach

The classical approach to using probability depends on several future events that are equally likely to happen. In rolling a die, for example, the odds are equally likely for rolling a 1, 2, 3, 4, 5 or 6. If you roll the die once, you have a 1 in 6 chance of getting the number you want. The formula is the number of favorable outcomes divided by the total number of possible outcomes. Note that if you roll the die twice, the odds are 2 in 12 that you will get the number you want (this is the same value as 1/6). This is because the possible outcomes double if you throw the die twice.

Using the Classical Approach in Business

You can use the classical approach to probability when making business decisions where you don't know the likelihood of several possible outcomes. You assume they are all equally likely, then look at how many attempts you will be able to make. However, in your business, if 6 possible outcomes are equally likely, but they are not affected by how many times you try, you can cut your odds in half with repeated effort. For example, if you make 2 tries, your effort will have a 2 in 6 chance. Notice that 2/6 = 1/3. You have moved from a 1 in 6 chance of success to a 1 in 3 chance.

Relative Frequency Approach

The relative frequency approach uses the past to make predictions about the future. You look at how many times an event has happened and then look at how many opportunities exist for the event to occur. The formula is the number of times an event occurred divided by the total number of opportunities for the event to occur.

Using Relative Frequency Approach in Business

You can use relative frequency to improve your business decisions. For example if your research shows there are 75 failures for every 100 business startups attempted, you would say that 75 out of 100 startups fail. This reduces to 3/4. That would mean 3 out of 4 startups fail. If you don't do something to change your odds, you can expect that failure probability. This mathematical reality can give you a sense of urgency in your efforts to be the 1 out of 4 that succeeds. In fact, you could study the successes to see how they changed the odds in their favor.

__________________________________________________________________________

Write a summary or highlights from the article. (100 to 120 words)

In: Statistics and Probability

I'm working on a python programming problem where I have to write a program that plays...

I'm working on a python programming problem where I have to write a program that plays rock paper scissors.

our program will allow a human user to play Rock, Paper, Scissors with the computer. Each round of the game will have the following structure:

  • The program will choose a weapon (Rock, Paper, Scissors), but its choice will not be displayed until later so the user doesn’t see it.
  • The program will announce the beginning of the round and ask the user for his/her weapon choice
  • The two weapons will be compared to determine the winner (or a tie) and the results will be displayed by the program
  • The next round will begin, and the game will continue until the user chooses to quit
  • The computer will keep score and print the score when the game ends

The computer should select the weapon most likely to beat the user, based on the user’s previous choice of weapons. For instance, if the user has selected Paper 3 times but Rock and Scissors only 1 time each, the computer should choose Scissors as the weapon most likely to beat Paper, which is the user’s most frequent choice so far. To accomplish this, your program must keep track of how often the user chooses each weapon. Note that you do not need to remember the order in which the weapons were used. Instead, you simply need to keep a count of how many times the user has selected each weapon (Rock, Paper or Scissors). Your program should then use this playing history (the count of how often each weapon has been selected by the user) to determine if the user currently has a preferred weapon; if so, the computer should select the weapon most likely to beat the user’s preferred weapon. During rounds when the user does not have a single preferred weapon, the computer may select any weapon. For instance, if the user has selected Rock and Paper 3 times each and Scissors only 1 time, or if the user has selected each of the weapons an equal number of times, then there is no single weapon that has been used most frequently by the user; in this case the computer may select any of the weapons.

At the beginning of the game, the user should be prompted for his/her input. The valid choices for input are:

  • R or r (Rock)
  • P or p (Paper)
  • S or s (Scissors)
  • Q or q (Quit)

At the beginning of each round your program should ask the user for an input. If the user inputs something other than r, R, p, P, s, S, q or Q, the program should detect the invalid entry and ask the user to make another choice.

Your program should remember the game history (whether the user wins, the computer wins, or the round is tied).

At the end of the game (when the user chooses ‘q’ or ‘Q’), your program should display the following:

  • The number of rounds the computer has won
  • The number of rounds the user has won
  • The number of rounds that ended in a tie
  • The number of times the user selected each weapon (Rock, Paper, Scissors)

In: Computer Science

Kamet is an investment fund that invests on the Ghana Stock Exchange. In recent times the...

Kamet is an investment fund that invests on the Ghana Stock Exchange. In recent times the economy has gone through four different cycles which analyst believe may be repeated in the years ahead. Kamet is reviewing its investment strategy and is looking for the best way to make good returns for its clients. The returns on three assets selected by Kamet are provided below: Business Cycle Probability Unilever Starwin Anglogold Normal 0.30 40% 40% 30% Boom 0.40 20% 45% 40% Near Recession 0.10 20% 30% 15% Recession ??? 12% 50% 30% You are required to: Compute the expected return and risk of each asset and advise Kamet as to which asset to invest more funds in on the basis of: expected return on the assets riskiness of the assets (Hint: compute the coefficient of variation of each asset and select the asset with the lowest coefficient of variation; CV= δ/(E(R))) Kamet has just informed you of three strategies (a), (b) and (c) that it wants to use. In this strategy, Kamet will invest in the order of expected return hence the highest proportion of its funds is to be invested starting from the asset that yields the highest expected return irrespective of the risk level. The order is as follows: Assets 1st Measured by Return 2nd Measured by Return 3rd Measured by Return Percentage of funds invested 45% 35% 20% (b). In this strategy, Kamet will invest in the order of riskiness of the assets hence the highest proportion of its funds is to be invested starting from the assets with the lowest risk irrespective of the expected return. The order is as follows. Assets 1st Measured by Risk 2nd Measured by Risk 3rd Measured by Risk Percentage of funds invested 50% 30% 20% (c). In this strategy, Kamet will invest in the order shown below Assets Unilever Starwin Anglogold Percentage of funds invested 30% 30% 40% Compute the portfolio expected return for each of the strategies (a), (b), and (c) and advise Kamet as to the best strategy to select on the basis of the expected return you have computed.

In: Finance

Consider two genes with different expected mutation rates due to size. Gene 1 has a mutation...

Consider two genes with different expected mutation rates due to size. Gene 1 has a mutation rate of 1 x 10-6 in the population, while gene 2 has a mutation rate of 3 x 10-6 in the population. Assume that the probability for an individual to have two mutations in one gene is 0. Also, the number of bases, n, in a gene is large.

  1. State the probability for gene 1 and for gene 2 that there is exactly one person with a mutation in the gene in a random sample of 1000 people.

  2. State the probability for gene 1 and for gene 2 that there is exactly one person with a mutation in either of the two genes in your sample.

  3. State the probability for each gene separately that they are exactly two people with mutations in your sample.

  4. State the probability that there is either zero or at least one person with a mutation in a gene in your sample.

  5. State the probability that there are more than two people with mutations total between the two genes in your sample.

  6. Consider the case that gene 2 controls the potential for mutation of gene 1. If gene 2 is mutated, gene 1 has a probability of 50% of being mutated, while if gene 2 is not mutated, gene 1 has a probability of 10% of being mutated. What is the probability that gene 1 is mutated in an individual.

In: Statistics and Probability

Many of a bank’s customers use its automatic teller machine to transact business after normal banking...

Many of a bank’s customers use its automatic teller machine to transact business after normal banking hours. During the early evening hours in the summer months, customers arrive at a certain location at the rate of one every other minute. This can be modeled using a Poisson distribution. Each customer spends an average of 99 seconds completing his or her transactions. Transaction time is exponentially distributed.


a. Determine the average time customers spend at the machine, including waiting in line and completing transactions. (Do not round intermediate calculations. Round your answer to the nearest whole number.)

Average time in minutes

b. Determine the probability that a customer will not have to wait upon arriving at the automatic teller machine. (Round your answer to 2 decimal places.)

Probability           

c. Determine the average number of customers waiting to use the machine. (Round your answer to 2 decimal places.)

Average number of customers

In: Statistics and Probability

3. In the following situations, identify the random variable of interest (e.g. ”Let X be the...

3. In the following situations, identify the random variable of interest (e.g. ”Let X be the number of ...”). Then state whether or not the r.v. is binomial, justifying your answer.

(a) A police officer randomly selects 30 cars to find out how many do not have

a current Warrant of Fitness (WOF). She knows from experience that the

probability a car does not have a current WOF is 1.6

(b) A data collector goes from house to house in a Wellington suburb to find the number of houses where the person answering the door (over the age of 18) agrees with a particular housing policy of the current government. The probability that a randomly selected adult in New Zealand agrees with the policy is known to be 0.4. The collector will stop collecting responses once they have 100 responses.

(c) Mike is repeatedly rolling two dice and will stop when he gets a double six. He counts the number of rolls until he gets a ’success’.

In: Math

Where a beneficiary is under a legal disability and is presently entitled:

Where a beneficiary is under a legal disability and is presently entitled:



Trustee pays the tax at the highest marginal rate



Trustee pays the tax on behalf of the beneficiary at marginal tax rates



Beneficiary pays the tax at the highest marginal rate



Beneficiary pays the tax at marginal rates

In: Accounting