What is the probability that the two rolls differ by exactly

Assignment Help Other Subject
Reference no: EM132383850

Assignment

Part1) Probability

Suppose that in a particular state, among the registered voters, 35% are democrats, 45 % are republicans, and the rest are independents. Suppose that a ballot question is whether to impose wealth tax on millionaires or not. Suppose that 75% of democrats, 20% of republicans, and 50% of independents favor the wealth tax.

If a person is chosen at random that favors the sales tax, what is the probability that the person is

i) a democrat?

ii) a republican,

iii) an independent.

Show the solutions with the calculations without using R. Then, verify your answers with the bayes function provided in the code samples.

Part2) Random Variables

a) Consider the experiment of rolling a pair of dice. Using R, show how would you define a random variable for the absolute value of the difference of the two rolls.

b) Using the above result, what is the probability that the two rolls differ by exactly 2? What is the probability that the two rolls differ by at most 2? What is the probability that the two rolls differ by at least 3? Use the Prob function as shown in the code samples.

c) Show the marginal distribution of the above random variable (using R).

d) Using R, add another random variable to the above probability space using a user defined function. The random variable is TRUE if the two rolls differ by 2, and FALSE otherwise. Making use of this random variable, what is the probability that the two rolls differ by 2? Show
also the marginal distribution for this random variable.

Part3) Functions

Using a for loop, write your own R function, evensum(data), that returns the sum of all the even values in the given numeric data vector.
Now, without using any loop, write your own R function, evensum2(data), that returns the sum of all the even values in the given numeric data vector.

Test both functions with sample data.

Part4) R -

Initialize the Dow Jones Industrials daily closing data as shown below:
dow <- read.csv

Provide the simplest R code and output for all of the following. The code should work for any given data.

a) Use the diff function to calculate the differences between consecutive values.

Insert the value 0 at the beginning of these differences. Add this result as the DIFFS column of the data frame.

b) How many days did the Dow close higher than its previous day value? How many days did the Dow close lower than its previous day value?

c) Show the subset of the data where there was a gain of at least 500 points from its previous day value.

d) Show the above result by adding the previous day value to the result in c) as below.

d) Provide the solution to compute the longest gaining streak of at least 200 points in the data.

Show the data for that longest gaining streak. Hint: Use the rle function provided by R.

Reference no: EM132383850

Questions Cloud

Identify solution that both ethical and business appropriate : Use the decision making model/case analysis instructions to identify a solution that is both ethical and business appropriate
Management a critical incident high performer : You're in you are an elementary school principal. one of your best teachers perhaps the best is causing a bit of uproar. she is in her second year on staff
Prioritizing and managing interruptions effective practice : How is goal setting, prioritizing and managing interruptions an effective practice in time management to prioritize time for critical issues in the workplace?
How do you define a global strategy : How do you define a global strategy? Compare and contrast global strategy with other international expansion strategies.
What is the probability that the two rolls differ by exactly : Using the above result, what is the probability that the two rolls differ by exactly 2? What is the probability that the two rolls differ by at most 2?
Summarize the risks that american apparel : What strategies can American Apparel use to mitigate these risks or turn them into opportunities?
Google to remove applications it considers inappropriate : In 2014, Symantec found that 17 percent of all Android apps were malware in disguise. But a report by Google found that less than 1 percent
Determine how victims are portrayed : For this week's assignment, you will reflect on the media's portrayal of crime and how it may contribute to victim blaming? It may help to identify a specific.
Give us an example of a well developed business : Give us an example of a well developed business case and provide to us a good structure on how to write business cases

Reviews

Write a Review

Other Subject Questions & Answers

  Separates industrial society from preindustrial society

A primary feature that separates an industrial society from a preindustrial society is:

  Discuss difficult to embrace with a fluid or growth mindset

What 5 key principles of effective differentiation and will be the most difficult to embrace with a fluid or growth mindset

  How depression affects the brain

How depression affects the brain, How depression affects males and Females differently

  Describe the pros and cons of this new phenomenon

Describe the pros and cons of this new phenomenon and explain where the greatest shifts can occur. Identify and describe some of the ways technology is changing the emergency management field.

  Intelligence strengths and learning style

How can you use your multiple intelligence strengths and learning style to form positive academic habits? Provide a minimum of two examples in your response.

  Significance of code enforcement research

Evaluate the significance of code enforcement research conducted by the Urban Institute, National Fire Protection Association (NFPA), the National Science Foundation, and the U.S. Fire Administration/National Fire Academy.

  Discuss the causes and consequences of the depression

Discuss the causes and consequences of the Depression? Why were Mussolini and Hitler able to gain power and engage in territorial expansion with such ease prior to 1939?

  What attachment styles characterize adults

What attachment styles characterize adults, and how they are linked to relationships outcomes

  What messages are they trying to convey in their poetry

Write a comparison, using poems from the assigned reading, that includes at least three terms defined in the Poetry Lecture .

  What are the tax consequences to allie and to broadbill corp

Allie forms Broadbill Corporation by transferring land (basis of $125,000, fair market value of $775,000), which is subject to a mortgage of $375,000. One month prior to incorporating Broadbill

  The marketing department at texas instruments has found

the marketing department at texas instruments has found that when certain calculators are sold at a price of p dollars

  What is one of the greatest examples of insider trading

What is one of the greatest examples of insider trading where there was a significant detrimental outcome for investors?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd