Questions
A Betting Game You roll a die. If an odd number comes up, you lose. If...

  1. A Betting Game

You roll a die. If an odd number comes up, you lose. If you get a 6, you win $60. If it is an even number other than 6, you get to roll again. If you get a 6 the second time, you win $36. If not, you lose.

(a) Construct a probability model for the amount you win at this game. Explain briefly how you obtain the probabilities associated with the different amounts of winning.

(b) How much would you be willing to pay to play this game?

  1. Chris Again!

A true-false test consists of 10 items.

(a) If Chris does not study at all and guesses each and every item in the test, describe the probability model for the number of correct guesses.

(b) What is the probability that Chris gets 80% or more for the test?

(c) If it is a 20 item true-false test, would you think it is easier or more difficulty for Chris to get 80% or more? Explain without performing any further calculation.

In: Math

Stuck in the mud is a popular dice game in UK. The game uses five (5)...

Stuck in the mud is a popular dice game in UK. The game uses five (5) 6-sided dice to play. The players play in turns.

Choose one player to start the game. The player will roll all five (5) dice. If the player rolled any 2s or 5s, the player does not score any points for this throw. The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values.

The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw. Throws without 2s and 5s are added to the previous total score.

Continue in this way until all the dice are stuck. Save the score and pass the dice to the next player.

Players can agree a total number of rounds to play in advance. Total up the score. The player with the highest score wins the game. The following link contains the detail game description: https://www.activityvillage.co.uk/stuck-in-the-mud.

Write a MATLAB program to simulate the Stuck in the Mud game with additional features that can:

Use five (5) 6-sided dice to automatically play the Stuck in the Mud game against a player.

Greet the player when the game starts.

Let the player to choose the number of rounds to play. Take care of the user input to ensure the program will not crash with inputs like 0, 1.2, -1, 999, and so on...

The program should not play if the user enters a 0 or any negative value.

The program should accurately play the number of rounds specified by the user. The player and the computer play in turns for each round.

The program can always pick one side to start the game first, either the player side or the computer side. Randomly pick a side to start the rotation is optional.

Print the current round number clearly in the command window.

If the player side starts first, the program will automatically roll all five (5) dice for the player. If the player rolled any 2s or 5s, the player does not score any points for this throw. The player can only score on a roll which does not include the number 2 and 5. Any dice with a 2 or a 5 becomes stuck in the mud. If this throw does not contain any 2s or 5s, the score is incremented by the sum of the dice values. The player needs to set aside any 2s and 5s and throw the remaining dice. Again, if any 2s or 5s are rolled, the score will not be incremented for this throw. Throws without 2s and 5s are added to the previous total score. Continue in this way until all the dice are stuck.

The dice rolled for the player, the stuck dice, and the scores during the process should clearly be printed in the command window.

The program then automatically roll all five (5) dice for the computer. Follow the game rules until all five (5) dice are stuck.

The dice rolled for the computer, the stuck dice, and the scores during the process should also be clearly printed in the command window.

Accurately track the total scores for the player and the computer.

After all the rounds have been played, select a winner based on the highest total score. It is also possible that the game ends in a tie.

Add voice to the game to report the details of the game for the player. o Pre-recorded computer voices, computerVoices.zip, can be downloaded from moodle.

o The following websites can convert any text into voices with downloadable mp3 files. § www.fromtexttospeech.com

§ www.text2speech.org

o If you have a mic, you can also record your own voice using the Windows Sound Recorder.

o MATLAB can play any WMA, MP3, MPEG-4 AAC, WAV, FLAC audio files.

[y,Fs] = audioread('fileName.mp3'); % read sound file

sound(y,Fs); % play sound file

o Additional sound effects are welcome.

Add voice to greet the player.

Add voice to ask the player to enter the number of rounds to play.

Add voice to announce the current round number (i.e., round 1, round 2, and so on…).

Add voice to announce the current turn (i.e. the player is rolling or the computer is rolling).

Add voice to announce the current roll number (i.e. roll 1, roll 2, and so on…).

Add voice to announce each dice rolled.

Add voice to announce the sum of the score for the current turn after each throw.

Add voice to announce the number of dice stuck after each throw.

After one side played, add voice to announce the current total score for the side. For example, 35 points can be announced as three-five.

After all the rounds are played, add voice to announce the winner or tie.

Add pause as needed between sentences to ensure one sentence is finished before the next sentence starts.

Use at least one user-defined function in the program to reduce code repetition.

The finished program can look like the following example. Extra components are always welcome.

Games do not make you violent, lag does.

Got lag? Kill the lag with a dice game. (Play a voice greeting.)

(Play a voice to request the user input.)

Enter the number of rounds to play: 2

ROUND 1!!! (Announce round #1.)

The player starts first: (Announce the player’s turn.)

   ROLL 1 (Announce roll #1.)

Rolling: 5 1 4 5 6 (Announce rolling 5-1-4-5-6.)

Stuck in the mud: 5 5

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 2 (Announce the number of dice stuck: 2)

   ROLL 2 (Announce roll #2.)

Rolling: 2 2 2 (Announce rolling 2-2-2.)

Stuck in the mud: 5 2 2 5 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The player scores: 0 (Announce the player score: 0)

The Player Total Scored: 0 (Announce the player total score: 0)

The computer goes next: (Announce the computer’s turn.)

    ROLL 1 (Announce roll #1.)

Rolling: 2 4 3 5 4 (Announce rolling 2-4-3-5-4.)

Stuck in the mud: 2 5

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 2 (Announce the number of dice stuck: 2)

ROLL 2 (Announce roll #2.)

Rolling: 1 2 4 (Announce rolling 1-2-4.)

Stuck in the mud: 2 2 5

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 3 (Announce the number of dice stuck: 3)

   ROLL 3 (Announce roll #3.)

Rolling: 4 2 (Announce rolling 4-2.)

Stuck in the mud: 2 2 5 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 4 (Announce roll #4.)

Rolling: 5 (Announce rolling 5.)

Stuck in the mud: 2 5 2 5 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The computer scores: 0 (Announce the computer score: 0)

The Computer total scored: 0 (Announce the computer total score: 0)

   ROUND 2!!! (Announce round #2.)

The player starts first: (Announce the player’s turn.)

   ROLL 1 (Announce roll #1.)

Rolling: 2 4 4 2 5 (Announce rolling 2-4-4-2-5.)

Stuck in the mud: 2 2 5

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 3 (Announce the number of dice stuck: 3)

   ROLL 2 (Announce roll #2.)

Rolling: 2 2 (Announce rolling 2-2.)

Stuck in the mud: 2 2 2 2 5

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The player scores: 0 (Announce the player score: 0)

The Player Total Scored: 0 (Announce the computer score: 0)

The computer goes next: (Announce the computer’s turn.)

   ROLL 1 (Announce roll #1.)

Rolling: 4 4 1 1 1 (Announce rolling 4-4-1-1-1.)

Stuck in the mud:

   Game score: 11 (Announce the score: 1-1)

   Number of dice stuck: 0 (Announce the number of dice stuck: 0)

   ROLL 2 (Announce roll #2.)

Rolling: 1 4 5 6 4 (Announce rolling 1-4-5-6-4.)

Stuck in the mud: 5

   Game score: 11 (Announce the score: 1-1)

   Number of dice stuck: 1 (Announce the number of dice stuck: 1)

   ROLL 3 (Announce roll #3.)

Rolling: 6 5 1 1 (Announce rolling 6-5-1-1.)

Stuck in the mud: 5 5

   Game score: 11 (Announce the score: 1-1)

   Number of dice stuck: 2 (Announce the number of dice stuck: 2)

   ROLL 4 (Announce roll #4.)

Rolling: 2 5 1 (Announce rolling 2-5-1.)

Stuck in the mud: 2 5 5 5

   Game score: 11 (Announce the score: 1-1)

   Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 5 (Announce roll #5.)

Rolling: 5 (Announce rolling 5.)

Stuck in the mud: 2 5 5 5 5

   Game score: 11 (Announce the score: 1-1)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The computer scores: 11 (Announce the computer score: 1-1)

The Computer total scored: 11 (Announce the computer total score: 1-1)

The computer wins! (Announce the computer wins.)

>>

The program should end when the player wants to play 0 round.

Games do not make you violent, lag does.

Got lag? Kill the lag with a dice game. (Play a voice greeting.)

(Play a voice to request the user input.)

Enter the number of rounds to play: 0

The game ends with a tie (Announce the game ends in a tie.)

>>

The program should be able to handle a negative input.

Games do not make you violent, lag does.

Got lag? Kill the lag with a dice game. (Play a voice greeting.)

(Play a voice to request the user input.)

Enter the number of rounds to play: -1

The game ends with a tie (Announce the game ends with a tie.)

>>

The program should be able to handle a floating point input without crashing.

(The following example takes the floor value of 1.2 and only runs 1 round. )

Games do not make you violent, lag does.

Got lag? Kill the lag with a dice game. (Play a voice greeting.)

(Play a voice to request the user input.)

Enter the number of rounds to play: 1.2

ROUND 1!!! (Announce round #1.)

The player starts first: (Announce the player’s turn.)

   ROLL 1 (Announce roll #1.)

Rolling: 3 6 2 2 6 (Announce rolling 3-6-2-2-6.)

Stuck in the mud: 2 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 2 (Announce the number of dice stuck: 0)

   ROLL 2 (Announce roll #2.)

Rolling: 4 4 4 (Announce rolling 4-4-4.)

Stuck in the mud: 2 2

   Game score: 12 (Announce the score: 1-2)

   Number of dice stuck: 2 (Announce the number of dice stuck: 2)

   ROLL 3 (Announce roll #3.)

Rolling: 3 1 5 (Announce rolling 3-1-5.)

Stuck in the mud: 2 2 5

   Game score: 12 (Announce the score: 1-2)

   Number of dice stuck: 3 (Announce the number of dice stuck: 3)

   ROLL 4 (Announce roll #4.)

Rolling: 6 5 (Announce rolling 6-5.)

Stuck in the mud: 5 2 2 5

   Game score: 12 (Announce the score: 1-2)

   Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 5 (Announce roll #5.)

Rolling: 1 (Announce rolling 1.)

Stuck in the mud: 5 2 2 5

   Game score: 13 (Announce the score: 1-3)

    Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 6 (Announce roll #6.)

Rolling: 1 (Announce rolling 1.)

Stuck in the mud: 5 2 2 5

   Game score: 14 (Announce the score: 1-4)

Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 7 (Announce roll #7)

Rolling: 5 (Announce rolling 5.)

Stuck in the mud: 5 5 2 2 5

   Game score: 14 (Announce the score: 1-4)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The player scores: 14 (Announce the player score: 1-4)

The Player Total Scored: 14 (Announce the player total score: 1-4)

The computer goes next: (Announce the computer’s turn.)

   ROLL 1 (Announce roll #1.)

Rolling: 6 5 6 4 2 (Announce rolling 6-5-6-4-2.)

Stuck in the mud: 5 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 2 (Announce the number of dice stuck: 2)

   ROLL 2 (Announce roll #2.)

Rolling: 2 4 5 (Announce rolling 2-4-5.)

Stuck in the mud: 2 5 5 2

   Game score: 0 (Announce the score: 0)

   Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 3 (Announce roll #3.)

Rolling: 4 (Announce rolling 4.

Stuck in the mud: 2 5 5 2

   Game score: 4 (Announce the score: 4)

   Number of dice stuck: 4 (Announce the number of dice stuck: 4)

   ROLL 4 (Announce roll #4.)

Rolling: 2 (Announce rolling 2.)

Stuck in the mud: 2 5 2 5 2

   Game score: 4 (Announce the score: 4)

   Number of dice stuck: 5 (Announce the number of dice stuck: 5)

The computer scores: 4 (Announce the computer score: 4)

The Computer total scored: 4 (Announce the computer total score: 4)

The player wins! (Announce the player wins.)

>>

In: Computer Science

Consider an ideal quantum gas of Fermi particles at a temperature T, a) Write the probability...

Consider an ideal quantum gas of Fermi particles at a temperature T,
a) Write the probability p(n) that there are n particles in a state of one particle given as a function of the average occupation number, <n>.
b) Find the root of the fluctuation to the average square in the occupation number of a single-particle state as a function of the occupation number
average <n>. Sketch the result

In: Physics

A box contains 90 discs numbered 1 to 90. One disc is drawn at random from the box. What is the probability that is bears

A box contains 90 discs numbered 1 to 90. One disc is drawn at random from the box. What is the probability that is bears

 

(i) a two-digit number

 

(ii) a perfect square

 

(iii) a multiply of 5

 

(iv) a number divisible by 3 and 5.

In: Statistics and Probability

3) the number of insurance claims per year by a randomly selected employee follow a Poission...

3) the number of insurance claims per year by a randomly selected employee follow a Poission distribution with mean .5. let us observe four such employees. assuming independence, compute the probability that their total number of insurance claims in a year is less than 2.

In: Statistics and Probability

For an urn containing 4 red balls and 6 green balls, let the number of balls...

For an urn containing 4 red balls and 6 green balls, let the number of balls randomly drawn be the number of heads turning up when 5 fair coins have been previously flipped. What is the probability of drawing 3 green balls?

In: Statistics and Probability

The number of errors in each of 300 files has a Poisson distribution with 1.4 errors...

The number of errors in each of 300 files has a Poisson distribution with 1.4 errors per file on average. Assume the errors in different files are independent. Use the Central Limit Theorem to approximate the probability that the total number of errors is at least 400. (Use a calculator.)

In: Statistics and Probability

Clark 202 Part 1: Approximately how many bits are required to address a 4M x 16...

Clark 202

Part 1: Approximately how many bits are required to address a 4M x 16 main memory if:

a. Main memory is byte addressable?

b. or Main memory is word addressable?

Part 2: Consider 256 x 8 RAM chips for the following:

a. About how many are needed to provide a memory capacity of 4096 bytes?

b. How many lines must go to each and every chip?

Part 3: Digital computers have a memory unit with 24 bits per each word. The instruction set consists

of 150 different operations. All instructions have an operation code part (opcode) and

an address portion (allowing for only one address). Each instruction is stored in approximately one word

of memory.

a. How many bits are needed for the opcode?

b. How many bits are left for the address part of the instruction?

c. What is the approximate maximum allowable size for memory?

d. Please explain what is the largest unsigned binary number that can be accommodated in one word

of memory

Part 4: Assume a 230-byte memory.

a. What are the smallest and highest addresses if memory is byte addressable?

b. What are the smallest and highest addresses if memory is word addressable,

assuming a 16-bit word?

c. What are the lowest and highest addresses if memory is word addressable,

assuming a 32-bit word?

Let me know if you have any questions.

In: Computer Science

Education. Post-secondary educational institutions in the United States (trade schools, colleges, universities, etc.) traditionally offer four...

Education. Post-secondary educational institutions in the United States (trade schools, colleges, universities, etc.) traditionally offer four different types of degrees or certificates. The U.S. Department of Education recorded the highest degree granted by each of these institutions in the year 2003. The percentages are shown in the table below. A random sample of 225 institutions was taken in 2013 and the number of institutions in the sample for each category is also shown in the table. Conduct a hypothesis test to determine whether there has been any change from the percentages reported in 2003. Round all calculated values to four decimal places.

Highest Degree Awarded Population percentages in 2003 Sample counts in 2013
Certificate 35.0% 80
Associates 26.6% 54
Bachelor's 11.3% 28
Graduate 27.1% 63

a. Enter the expected values for the hypothesis test in the table below.

Highest Degree Awarded Expected value
Certificate
Associates
Bachelor's
Graduate

b. Calculate the test statistic for this hypothesis test.  ? z t X^2 F  =

c. Calculate the degrees of freedom for this hypothesis test.

d. Calculate the p-value for this hypothesis test. p-value =

e. Based on the p-value, we have:
A. little evidence
B. strong evidence
C. very strong evidence
D. some evidence
E. extremely strong evidence
that the null model is not a good fit for our observed data.

In: Math

Use the following diagram and your intuition to answer the next fivequestions.   40.  The government removes a...

Use the following diagram and your intuition to answer the next fivequestions.  

40.  The government removes a tariff on imported consumer goods.  What is the most likely short-run effect on the aggregate price level and the level of unemployment?
A.   Price level increases, unemployment increases.
B.    Price level increases, unemployment decreases.
C.    Price level decreases, unemployment increases.
D.   Price level decreases, unemployment decreases.

41.  The level of aggregate output demanded decreases as the aggregate price level increases because
A.   higher prices make market interest rates decrease.
B.    as prices increase, producers will sell more output.
C.    higher prices decrease the value of household wealth.
D.   as prices increase, producers withhold output in anticipation of even higher prices.

42.  There is an increase in government spending.  Aggregate output will __________ and the aggregate price level will ___________.
A.   increase; increase
B.    increase; decrease
C.    decrease; increase
D.   decrease; decrease

43.  There is an increase in saving by households.  Unemployment will ___________ and inflation will ___________.
A.   increase; increase
B.    increase; decrease
C.    decrease; increase
D.   decrease; decrease

44.  In an aggregate demand/aggregate supply diagram, ____________ is plotted on the vertical axis and _____________ is plotted on the horizontal axis.
A.   price; quantity
B.    aggregate price level; aggregate output
C.    quantity; price
D.   aggregate output; aggregate price level

45.  In a closed economy, with no government sector, when planned saving is less than planned investment
A.   actual investment will exceed actual saving.
B.    actual saving will exceed actual investment.
C.    unplanned inventory investment will be positive.
D.   unplanned inventory investment will be negative.

46.  In the short run, if private investment increases we could correctly state that
A.   the aggregate demand curve will shift to the right.
B.    private saving will increase because investment and saving must be equal.
C.    private saving will decrease because investment is the opposite of saving.
D.   the aggregate demand curve will shift to the left.

47.  Which of the following is included in GDP but not in national income?
A.   Capital consumption allowance.
B.    Undistributed corporate profits.
C.    Personal income taxes.
D.   Dividends.

48.  In Arbez, between 2008 and 2009, nominal GDP rose by 3.6% while real GDP fell by 1.2%. We can conclude that, between 2008 and 2009, the aggregate price level
A.   rose by about 4.8%.
B.    rose by about 2,4%.
C.    fell by about 2.4%.
D.   fell by about 4.8%.

49.  GDP is 1,200, consumption is 900, planned gross private investment is 150, exports are 50, imports are 125.  Government spending is 300.  Inventories will
A.   rise by 75.
B.    rise by 325.
C.    fall by 75.
D.   fall by 325.

50.  The value of GDP can be found by adding together
A.   wages, investment, government spending, and depreciation.
B.    consumption, government spending, transfer payments, and net exports.
C.    wages, consumption, investment, and imports.
D.   consumption, investment, government spending, and net exports.

In: Economics