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

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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