Questions
Suppose the number of TV's in a household has a binomial distribution with parameters n =...

Suppose the number of TV's in a household has a binomial distribution with parameters n = 17, and p = 80 %. Find the probability of a household having: A. 12 or 14 TV's B. 12 or fewer TV's C. 15 or more TV's D. Fewer than 14 TV's C. more than 1 Tv's

In: Statistics and Probability

Suppose the number of cars in a household has a binomial distribution with parameters n =...

Suppose the number of cars in a household has a binomial distribution with parameters n = 12, and p = 10 %. Find the probability of a household having: (a) 1 or 5 cars (b) 3 or fewer cars (c) 9 or more cars (d) fewer than 5 cars (e) more than 3 cars

In: Statistics and Probability

python class Node(): def __init__(self, value): pass class PostScript(): def __init__(self): pass    def push(self, value):...

python

class Node():

def __init__(self, value):
pass

class PostScript():

def __init__(self):
pass
  
def push(self, value):
pass
  
def pop(self):
return None
  
def peek(self):
pass
  
def is_empty(self):
pass

def stack(self):
pass
  
def exch(self):
pass
  
def index(self):
pass
  
def clear(self):
pass
  
def dup(self):
pass
  
def equal(self):
pass
  
def depth(self):
pass
  
stack = PostScript()

def decode(command_list):
for object in command_list:
if object == '=':
stack.equal()
elif object == 'count':
stack.depth()
elif object == 'clear':
stack.clear()
elif object == 'dup':
stack.dup()
elif object == 'exch':
stack.exch()
elif object == 'index':
stack.index()
elif object == 'pop':
stack.pop()
elif object == 'stack':
stack.stack()
else:
stack.push(object)

command = input()
command_list = command.split()
decode(command_list)
  

For this assignment you are to implement a PostScript command interpreter using a Stack. You must implement the stack using a singly-linked list. Solutions that use a data structure other than a singly-linked list will received no credit.

The interpreter must read and execute a string of PostScript commands based on the following definitions:
1. =
objn objn-1 … obj1 = : objn-1 … obj1
This command removes the topmost object form the stack and prints it.

  1. count
    objn … obj1count : [depth of the stack] objn … obj1
    This command puts the depth of the stack on the top of the stack.
  2. clear
    objn … obj1clear : [empty stack]
    This command removes all objects from the stack.
  3. dup
    objn … obj1 = : objn objn … obj1
    This command adds a duplicate copy of the top object to the stack .
  4. exch
    objn objn-1 … obj1 exch : objn-1 objn … obj1
    This command exchanges the position of the top two elements of the stack.
  5. index
    objn … obj1 a index : objn … obja … obj1
    This command adds a copy of the ath object to the top the stack.
  6. pop
    objn objn-1 … obj1 pop : objn-1 …. obj1
    This command removes the top element from the stack.
  7. stack
    This command prints a copy of the entire stack, starting from the top and working to the bottom..

    The input will be a series of data and commands separated by a space. The data will go onto the stack. Commands do not go onto the stack. You must write at least one separate method for each of the commands. You may reuse the standard Stack methods discussed in class: push(), pop(), peek() and is_empty(). A template file has been provided.

  

In: Computer Science

1)Find the permutation and combination of the letters a, b, c, d taking 2 at a...

1)Find the permutation and combination of the letters a, b, c, d taking 2 at a time.

Verify your answers with the permutation & combination formula.2)

2.An urn contains 10 marbles. 3 blues, 4 yellow and 3 red marbles. 6 marbles is selected at random. Find the probability of picking 1 blue, 3 yellow marbles and 2 red ones.

3) A computer operator has to issue passwords made up of a letter followed by two digits. How many passwords are possible? Give two random passwords

4) In how many ways can you mark a 5-question test True / False? Give a random selection

5) A recent U.S survey shows that, the probability of living in California is 12%, the probability

of being Hispanic is 11% and the probability of being Hispanic and living in California is 4%.

Let H represents the events of “Being Hispanic” and L for living in CA. Evaluate i) P(H/L), ii)P(H U L)

6) A single card is picked at random. Find the probability of picking a red card or a 10.

7) a)Define mutually vs not mutually exclusive events give an example of two events that are mutually exclusive and two that are not.

b)Define independent events and give an example of an independent event and a dependent one.

c)Define independent events and give an example of an independent event and a dependent one.

8) a)A coin is tossed three times, use a tree diagram to construct all the possible outcomes.

8b)The odds-maker give the Yankees a 10 to 1 shot of winning the 2020 World Series.

What is the probability that the Yankees will win the 2020 World Series?

9)In Spring valley, NY about 56% of days in a year are cloudy. Find the mean,
variance and standard deviation for the number of cloudy days during the month of June

10) The probability that Yankees will 2020 world series is 20%.

Find the odds in favor that they will in fact win the 2020 world series? .20 to 1-.20 which reduces to 1 to 4 odds.

11. A sample task was given to 150 elementary school children.

The following table includes the times in minute it takes to complete the task.

minutes

# of kids

1

2

3

4

5

24

33

42

30

21

-----------

Total= 150

a) Construct a probability distribution for the random variable x

b) Graph the distribution using a histogram (Times in minutes VS probability)

c) Verify that the probability is in fact a probability distribution.

d) Find the mean, the variance and the standard deviation

12) The table shows the number of male and female students enrolled in nursing at University of Oklahoma Health Sciences center for a recent semester.

A student is selected at random. Find the probability of each event.

Nursing Majors     Non Nursing Majors     Total

Males                 94                    1104                             1198

Females             725                    1682                           2407

Total                  819                    2786                            3605

Calculate the probability of a) choosing a male or a nursing major is

b)      The student is a female or not a nursing major. c)The student is a female given that nursing major d) Calculate P(M U F), P( M n F)

15)The probability that a person in the United States has type A+ blood is 31%. Three people in the United States are selected at random. Find the probability that

a) All three has blood type A+   b) None of the three has blood type A+

c) At least one of the three has blood type A+. d)Which of the events can be considered unusual? Explain

In: Statistics and Probability

1) a) A certain kind of light bulb has a 8.5 percent probability of being defective....

1)

a) A certain kind of light bulb has a 8.5 percent probability of being defective. A store receives 54 light bulbs of this kind. What is the expected value (or mean value) of the number of light bulbs that are expected to be defective?

b) In a certain town, 19 % of the population develop lung cancer. If 25 % of the population are smokers and 85% of those developing lung cancer are smokers, what is the probability that a smoker in this town will develop lung cancer? Write your answer as a decimal accurate to three decimal places.

c) Suppose that 9.6 % of the items produced by a fifth factory are defective. If 6 items are chosen at random from the fifth factory, what is the expected value (or mean value) for the number of defective items? Write your answer as a decimal accurate to three decimal places.

d) Suppose that 5.1 % of the items produced by a fourth factory are defective. If 5 items are chosen at random from the fourth factory, what is the probability that at least two of the items are defective? Write your answer as a decimal accurate to three decimal places.

e) Suppose that 8.8 % of the items produced by a third factory are defective. If 5 items are chosen at random from the third factory, what is the probability that exactly two of the items are defective? Write your answer as a decimal accurate to three decimal places.

2)

a)   Suppose that 5.7 % of the items produced by a second factory are defective. If 5 items are chosen at random from the second factory, what is the probability that exactly one of the items is defective? Write your answer as a decimal accurate to three decimal places.

b) Suppose that 3.4 % of the items produced by a factory are defective. If 5 items are chosen at random, what is the probability that none of the items are defective? Write your answer as a decimal accurate to three decimal places.

c) A box contains 10 white marbles and 7 black marbles. Suppose we randomly draw a marble from the box, replace it, and then randomly draw another marble from the box. (This means that we might observe the same marble twice). What is the probability that both the marbles are white? Write your answer as a decimal accurate to three decimal places.

d) A drawer contains 9 white socks and 7 black socks. Two different socks are selected from the drawer at random. What is the probability that both of the selected socks are white? Write your answer as a decimal accurate to three decimal places.

In: Statistics and Probability

Question 4. Your friend Joanna is running for class president and has the support of 55%...

Question 4. Your friend Joanna is running for class president and has the support of 55% of the total student body. You poll a group of N students (N=50 or N=150) and compute the total number of students who state that they will vote for Joanna. For samples of size N=50 or N=150, use R to simulate 10,000 independent samples and record the total votes for Joanna in each sample. For each sample, compute a Z-score test statistic for the specified null hypothesis and α given below.

Compute the following (a-f) for both N=50 and N=150 separately.

a) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>1.96, does the simulated Type I error probability match the expected Type I error probability (α).

b) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

c) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

d) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>2.575, does the simulated Type I error probability match the expected Type I error probability (α).

e) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

f) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

g) What factors (N, α, |?0 − ??|) (if any) influence the Type I error probability? Explain.

h) What factors (N, α, |?0 − ??|) (if any) influence the Type II error probability? Explain.

In: Statistics and Probability

Question 4. Your friend Joanna is running for class president and has the support of 55%...

Question 4. Your friend Joanna is running for class president and has the support of 55% of the total student body. You poll a group of N students (N=50 or N=150) and compute the total number of students who state that they will vote for Joanna. For samples of size N=50 or N=150, use R to simulate 10,000 independent samples and record the total votes for Joanna in each sample. For each sample, compute a Z-score test statistic for the specified null hypothesis and α given below.

Compute the following (a-f) for both N=50 and N=150 separately.

a) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>1.96, does the simulated Type I error probability match the expected Type I error probability (α).

b) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

c) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>1.96, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

d) Plot a histogram of the resulting Z-score distribution under H0: p=0.55. Based on a rejection region of |Z|>2.575, does the simulated Type I error probability match the expected Type I error probability (α).

e) Plot a histogram of the resulting Z-score distribution under H0: p=0.6. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

f) Plot a histogram of the resulting Z-score distribution under H0: p=0.65. Based on a rejection region of |Z|>2.575, does the simulated Type II error probability match the expected Type II error probability. You will need to compute the expected Type II error probability (β).

g) What factors (N, α, |?0−??|) (if any) influence the Type I error probability? Explain.

h) What factors (N, α, |?0−??|) (if any) influence the Type II error probability? Explain.

In: Statistics and Probability

The following algorithm is widely used for checking whether a credit or debit card number has...

The following algorithm is widely used for checking whether a credit or debit card number has been entered correctly on a website. It doesn't guarantee that the credit card number belongs to a valid card, but it rules out numbers which are definitely not valid. Here are the steps:

  1. Check that the long number has exactly 16 digits. If not, the long number is not valid.
  2. If the long number has 16 digits, drop the last digit from the long number, as this is the "check digit" that we want to check against.  
  3. Multiply by 2 the value of each digit starting from index 0 and then at each even index. In each case, if the resulting value is greater than 9, subtract 9 from it. Leave the values of the digits at the odd indexes unchanged.
  4. Add all the new values derived from the even indexes to the values at the odd indexes and call this S.
  5. Find the number that you would have to add to S to round it up to the next highest multiple of 10. Call this C. If C equals the check digit, then the long number could be valid.

Example

Here is a worked example using the long number "4916592478445662".

  1. There are exactly 16 digits.
  2. So, create a new string including the first fifteen digits of the long number, i.e. "491659247844566" and note that the dropped digit, 2, is the check digit.
  3. Multiply by 2 the value of each remaining digit starting from index 0 and then each even index. In each case, if the resulting value is greater than 9, subtract 9 from it (which reduces larger values to a single digit). Leave the values of the digits at the odd indexes unchanged.
longNumber index longNumber value at index values at even indexes multiplied by 2 Adjusted to a single digit by subtracting 9
0 4 8 8
1 9 9
2 1 2 2
3 6 6
4 5 10 1
5 9 9
6 2 4 4
7 4 4
8 7 14 5
9 8 8
10 4 8 8
11 4 4
12 5 10 1
13 6 6
14 6 12 3
  1. Find S by adding all the values in the last column:

    S = 8 + 9 + 2 + 6 + 1 + 9 + 4 + 4 + 5 + 8 + 8 + 4 + 1 + 6 + 3 = 78

  2. As S = 78, the next highest multiple of 10 is 80. To get from 78 to 80 you must add 2, so C = 2. As this equals the value of the last digit in the long number, the long number could be valid.

a- Write a public method called isCorrectLength() that takes no arguments and returns the boolean value true if the length of longNumber is 16 and false otherwise.

b - Write a public method firstFifteen() that returns a String consisting of the first fifteen characters in the longNumber.

c) - write a public method calculateCheckNumber() to find S and then use the expression S/10 * 10 + 10 – S to find C. The method should first create a string omitting the last digit of the longNumber and then find S by iterating through this string. (You may choose to do a separate iteration for the odd and even indexes, or you could do both in a single loop.)

In: Computer Science

java program plz number = 308.2 number = 14.9 number = 7.4 number = 2.8 number...

java program plz 

number = 308.2
number = 14.9
number = 7.4
number = 2.8
number = 3.9
number = 4.7
number = -15.4
number = 2.8

Sum = 329.3

In: Computer Science

Draw the pic The probability that a customer will purchase today’s special, the “Never Been Feta”...

Draw the pic

  1. The probability that a customer will purchase today’s special, the “Never Been Feta” burger, is 0.27. Given that 9 customers are currently in line waiting to order, respond to the following:

a) What is the probability that exactly 5 specials will be sold to this set of customers?

         b) Determine the expected number of specials that will be sold.

            c) Calculate the standard deviation for this probability distribution.

2) It is known that at major sporting events only 60% of persons that use the washroom during a break in the action will wash their hands. Assuming that you had observed 14 people leave the washroom, answer the following:

a) The probability that exactly 4 of these people have washed their hands.

b) The probability that more than 10 of these people have washed their hands.

c) The probability that at least 4 of these people will have washed their hands.

d) The expected value for this probability distribution.

3) Based on years of historical data, the salary research firm, HR Pufnstuf, states that the annual salary for a Marketing Manager working on Living Island follows a normal distribution with a mean of $62,000 and a standard deviation of $8,000. Given this information determine the following:

  1. The probability that a randomly selected Marketing Manager on Living Island would earn an annual salary of more than $65,000.

       b) The probability that a Living Island Marketing Manager’s annual salary would be between $60,000 and $75,000.

  1. The percent of Marketing Manager’s on Living Island with an annual salary of less than $80,000.

  1. The probability that any given Marketing Manager’s annual salary on Living Island would be between $75,000 and $85,000.
  2. The 95th percentile, i.e. annual salary above which 5% of the Living Island’s Marketing Manager’s would earn.

4) It is known that the average age of major league baseball players is 28.3 years with a population standard deviation of 2.8 years. Determine the probability that the average age of 36 randomly selected National League baseball players is less than 27 years of age?

In: Statistics and Probability