Questions
this code should be in R. Write function(s) to drop the smallest one exm grade out...

this code should be in R.

Write function(s) to drop the smallest one exm grade out of several Exm grades. If a student misses an exm, the grade is NA. You must use NA instead of 0 to represent the value for exms missing. (a) Develop a function to convert an array to another array in which all NA grades are replaced with zero. (b) Complete your function to compute the mean of all elements row by row after dropping exactly one lowest grade. You cannot use any loop statement inside or outside your functions for both (a) and (b). You may use the built-in function in R to find the minimum value in an array. You may use ifelse() only once. You may use the built-in function mean() to find the mean. But be careful! For testing purpose, you may use the following exm grades for each student in each row:

            Exm 1          Exm 2         Exm 3          Exm 4

               80                  NA                90                  NA

               60                  80                  100                NA

               90                  80                  100                40

The average grade of each student must be displayed as a row in a matrix. For the exmple above, you need to display a 3 x 1 matrix with three rows of mean values in one column.

You may use functions: is.na() or na.omit().

In: Computer Science

Voltage sags and swells. The power quality of a transformer is measured by the quality of...

Voltage sags and swells. The power quality of a transformer

is measured by the quality of the voltage. Two

causes of poor power quality are “sags” and “swells.” A

sag is an unusual dip and a swell is an unusual increase in

the voltage level of a transformer. The power quality of

transformers built in Turkey was investigated in Electrical

Engineering (Vol. 95, 2013). For a sample of 103 transformers

built for heavy industry, the mean number of sags per

week was 353 and the mean number of swells per week

was 184. Assume the standard deviation of the sag distribution

is 30 sags per week and the standard deviation of the

swell distribution is 25 swells per week.

a. For a sag distribution with any shape, what proportion

of transformers will have between 263 and 443 sags per

week? Which rule did you apply and why?

b. For a sag distribution that is mound-shaped and symmetric,

what proportion of transformers will have between

263 and 443 sags per week? Which rule did you

apply and why?

c. For a swell distribution with any shape, what proportion

of transformers will have between 109 and 259 swells

per week? Which rule did you apply and why?

d. For a swell distribution that is mound-shaped and symmetric,

what proportion of transformers will have between

109 and 259 swells per week? Which rule did you

apply and why?

In: Statistics and Probability

Here is another infectious disease model. Once a person becomes infected, the time X, in days,...

Here is another infectious disease model. Once a person becomes infected, the time X, in days, until the person becomes infectious (can pass on the disease) can be modeled as a Weibull random variable with density function f(x,α,β) = α βα xα−1e−(x/β)α for 0 ≤ x ≤ ∞ and 0 otherwise with α = 3.7 and β = 7.1 α is the shape parameter and β is the scale parameter. Hint: Solve this with the built-in R functions for the Weibull distribution (dweibull(),pweibull(), qweibull()) not f as defined above. Otherwise you may get intermediate values too large to use. For a) and b) the text (and notes) give formulas for the answers. You can calculate from these formulas. Note that these formulas use the gamma function. Γ(α) is the gamma function. In R, there is a built-in function gamma() which calculates this.

a) What is the expected value of X? 6.4074

b) What is the variance of X? 3.719794

c) What is the standard deviation of X? 1.928677

d) What is the probability that X is larger than its expected value? 0.5045822

e) What is the probability that X is > 2? 0.9908345

f) What is the probability that X is > 4? 0.8872 g) What is the probability that X > 4 given that X > 2?

can you please solve that using R code . please

0.8954249 h) Calculate the 70th percentile of X. 459.273

In: Statistics and Probability

1. Let W1, . . . , Wn be i.i.d. N(µ, σ2). A 100(1 − α)%...

1. Let W1, . . . , Wn be i.i.d. N(µ, σ2). A 100(1 − α)% confidence interval for σ2 is

( ([n − 1]*S2 ) / (χ21−α/2,n−1 ) , ([n − 1]S2) / ( χ2α/2,n−1) ,

where χ2u,k denotes the 100×uth percentile of the χ2 distribution with k degrees of freedom, S2 = (n − 1)−1 * the sum of (Wi − Wbar )2 (from 1 to n) is the sample variance and Wbar = n−1 * the sum of Wi (from i = 1 to n) the sample mean.

(a) Suppose µ = 68, σ = 4, n = 12, and α = 0.05. Estimate the coverage probability of this random confidence interval for σ2 using a Monte Carlo simulation with 1e4 replications. That is, estimate the probability that the confidence interval captures σ2 . Denote this estimated probability by pbar. Comment on how 1 − α compares to ±1/ √ 1e4. You may use the qchisq function (hint: the χ2 distribution is not symmetric) but you may not use the built in rnorm function.

(b) Estimate the coverage probability for the confidence interval when W1, . . . , Wn are i.i.d. Exp(1). Notice that in this case σ2 = var(W1) = 1. Estimate the coverage probability pbar for each (n, α) ∈ {10, 50, 100} × {0.05, 0.1}. In each case, compare 1 − α to pbar ± 1/ √ 1e4. Again, you may not use the built in rexp function. Comment on the results.

In: Statistics and Probability

USING UNITED STATES IBC CHAPTER 7: 1. Roofing inter-layment shall have a minimum width of ____...

USING UNITED STATES IBC CHAPTER 7:

1. Roofing inter-layment shall have a minimum width of ____ inches.

A. 12                           B. 18                           C. 34                           D. 36

2. What is the minimum roof covering classification for a roof assembly on a building of Type IA construction?

A. Class A                   B. Class B                   C. Class C                   D. Non-classified

3. Roof assemblies consisting of metal sheets of shingle are considered ____ as roof assemblies.

A. A                            B. B                             C. C                             D. Special purpose

4. Double underlayment application is required beneath asphalt shingles on roofs having a maximum slope of ______.

A. 2:12                        B. 3:12                        C. 4:12                        D. 5:12

5. In areas subject to high winds, underlayment beneath asphalt shingles shall be fastened along the overlap at a maximum spacing of ____ inches.

A. 12                           B. 18                           C. 24                           D. 36

6. Define the following terms as per code:
     a. Built-up roof covering:

     b. Positive roof drainage:

     c. Scupper:

     d. Roof recover

7. List the test(s) that are used to measure the wind resistance of asphalt shingles.

8. Describe a product that meets the material requirements for wood shingles in roof

9. For built-up roofs, what test standard is used for the use of asphalt in roof?

10. Describe the code requirement in an area where there is a history of ice-forming along the eaves.

In: Civil Engineering

subject: International business Q. No. 3 Analyze the following situation and answer the questions given below...


subject: International business

Q. No. 3

Analyze the following situation and answer the questions given below

Max Marks 10

Should We Allow Global Corporation to Set Up a Factory in our Country?

About the business.  Global Corporation is applying for planning permission to build a factory in your country. The factory is expected to be very profitable. 1000 new jobs should be created for assembly-line work. Many of the goods made could be sold abroad. Some of the supplies for the factory will come from your country.

About your country.  In your country unemployment is high, especially amongst skilled workers. The government cannot afford any new building projects. There are several local competitors producing goods similar to the Global Corporation. Import levels are very high. Land for new building is very limited. New developments would have to be built in beautiful countryside.

Questions

i. List three groups in your country who may benefit from allowing the Global Corporation to build the factory.(1.5)

ii. List three groups in your country who may lose from the building of the factory.(1.5)

iii. Would you advise your government to allow the new factory to be built? Explain your answer by judging between or evaluating all of the evidence.(3)

In: Economics

subject: Digital marketing Eagle EV is a manufacturer of electric and gas-powered golf carts and UTVs...

subject: Digital marketing


Eagle EV is a manufacturer of electric and gas-powered golf carts and UTVs for personal and commercial use that has been around for more than 40 years. It is extremely well-known in the golf industry as a leading provider in well-built, functional vehicles to help golfers and staff get around the course in luxury, style, and class. If you’ve ever golfed at a challenging course with undulating and varying terrain, then you know how nice it is to be in a cart built for the conditions.

There’s no doubt that Eagle EV is the industry’s number one choice for outdoor adventure, however, the company was not utilizing its website and digital marketing efforts to its full potential. So that’s when Cardinal stepped in.

After meeting with the team at Eagle EV, the Digital Marketing team at your agency did an extensive evaluation of their marketing efforts and put a tracking system in place to effectively pinpoint areas of opportunity. Eagle EV knew that customers are always searching for the golf carts either by using brand name or general terms. Our goal was to analyze and funnel Eagle EV marketing dollars into the right places to be able to attract a higher return on investment.

Q.4 Recommend, how can you help Eagle EV target people who are searching for these products & what tools can be used to identify the search behavior of their customers.


In: Economics

Programming assignment 9 Write a function sortWords(array) that does the following: 1. Takes as an input...

Programming assignment 9
Write a function sortWords(array) that does the following:
1. Takes as an input a cell array of strings consisting of letters only. (1 pts)
2. Returns a cell array with all the strings in alphabetical order. (5 pts)
3. The function should ignore whether letters are lower case or upper case. (2 pts)
Test your function with the following: (2 pts)
>> sorted=sortWords({’Hello’,’hell’,’abc’,’aa’,’aza’,’aab’,’AaBb’,’a’}) sorted =
’a’ ’aa’ ’aab’ ’AaBb’ ’abc’ ’aza’ ’hell’ ’Hello’
Note: Your function may not contain any built-in MATLAB function(s) that deal with sorting or finding minimum values. If your function does use these built-in functions, up to 8 points may be deducted from your total.
Hint: Use the program sharkSort(vec) as a starting point and amend it so that it works for this programming assignment. For example your function could start as follows (fill in the blanks as necessary):
function sortedarray=sortWords(array) sortedarray={}; while ~isempty(array) [m,pos]=findSmallest(array); array(pos)=[]; sortedarray=[sortedarray m]; end
function [m,pos]=findSmallest(array) m = ...; pos=1; for i=2:length(array) if isLessWord(...,m) m = ...; pos= i; end end
function less=isLessWord(wordA,wordB) worda=lower(wordA); wordb=lower(wordB);

In: Computer Science

Related to Checkpoint​ 13.5) ​ (Real options and capital​ budgeting)  You are considering introducing a new​...

Related to Checkpoint​ 13.5) ​ (Real options and capital​ budgeting)  You are considering introducing a new​ Tex-Mex-Thai fusion restaurant. The initial outlay on this new restaurant is

​$6.96.9

million and the present value of the free cash flows​ (excluding the initial​ outlay) is

​$5.35.3

​million, such that the project has a negative expected NPV of

​$1.61.6

million. Upon closer​ examination, you find that there is a

5555

percent chance that this new restaurant will be well received and will produce annual cash flows of

​$805 comma 000805,000

per year forever​ (a perpetuity), while there is a

4545

percent chance of it producing a cash flow of only

​$199 comma 000199,000

per year forever​ (a perpetuity) if it​ isn't received well. The required rate of return you use to discount the project cash flows is

10.110.1

percnet. ​ However, if the new restaurant is​ successful, you will be able to build

1515

more of them and they will have costs and cash flows similar to the successful​ restaurant's costs and cash flows.

a.  In spite of the fact that the first restaurant has a negative​ NPV, should you build it​ anyway? Why or why​ not?

b.  What is the expected NPV for this project if only one restaurant is built but​ isn't well​ received? What is the expected NPV for this project assuming

1515

more are built if the first restaurant is well​ received? ​ (Ignore the fact that there would be a time delay in building additional new​ restaurants.)

In: Accounting

Write a Python program that computes certain values such as sum, product, max, min and average...

Write a Python program that computes certain values such as sum, product, max, min and average of any 5 given numbers along with the following requirements.

Define a function that takes 5 numbers, calculates and returns the sum of the numbers.

Define a function that takes 5 numbers, calculates and returns the product of the numbers.

Define a function that takes 5 numbers, calculates and returns the average of the numbers. Must use the function you defined earlier to find the sum of the five numbers.

Define a function that takes 5 numbers, finds and returns the largest value among the numbers. Must use conditional statements and NOT use built-in max function.

Define a function that takes 5 numbers, finds and returns the smallest value among the numbers. Must use conditional statements and NOT use any built-in min function.

Define a function called main inside which Prompt users to enter 5 numbers. Call all the functions passing those 5 numbers entered by the user and display all the returned answers with proper descriptions.

Define a function called test For each of the functions you defined (6-10) write at least 2 automated test cases using assert statements to automatically test and verify that the functions are correctly implemented. make your program continue to run and calculate the same statistical values of as many sets of 5 numbers as a user wishes until they want to quit the program.

In: Computer Science