15.1 Write some statements to simulate spinning a coin 50 times using 0-1 vectors
instead of a forloop. Hints:Generate a vector of 50 random numbers, set up
0-1 vectors to represent the heads and tails, and usedoubleandcharto
display them as a string ofHs andTs.
15.2 In a game of Bingo the numbers 1 to 99 are drawn at random from a bag.
Write a script to simulate the draw of the numbers (each number can be drawn
only once), printing them ten to a line.
15.3 Generate some strings of 80 random alphabetic letters (lowercase only). For
fun, see how many real words, if any, you can find in the strings.
15.4 A random number generator can be used to estimateπas follows (such a
method is called aMonte Carlomethod). Write a script which generates random points in a square with sides of length 2, say, and which counts what
proportion of these points falls inside the circle of unit radius that fits exactly
into the square. This proportion will be the ratio of the area of the circle to that
of the square. Hence estimateπ. (This is not a very efficient method, as you
will see from the number of points required to get even a rough
approximation.)
15.5 Write a script to simulate the progress of the short-sighted student in Chapter
16 (Markov Processes). Start him at a given intersection, and generate a
random number to decide whether he moves toward the internet cafe or home,
according to the probabilities in the transition matrix. For each simulated walk,
record whether he ends up at home or in the cafe. Repeat a large number of
times. The proportion of walks that end up in either place should approach the
limiting probabilities computed using the Markov model described in Chapter
16.Hint:If the random number is less than 2/3 he moves toward the cafe
(unless he is already at home or in the cafe, in which case that random walk
ends), otherwise he moves toward home.
15.6 The aim of this exercise is to simulate bacteria growth.
Suppose that a certain type of bacteria divides or dies according to the
following assumptions:
(a) during a fixed time interval, called ageneration, a single bacterium
divides into two identical replicas with probabilityp;
(b) if it does not divide during that interval, it dies;
(c) the offspring (called daughters) will divide or die during the next
generation, independently of the past history (there may well be no
offspring, in which case the colony becomes extinct).
Start with a single individual and write a script which simulates a number of
generations. Takep=0.75. The number of generations which you can
simulate will depend on your computer system. Carry out a large number (e.g.
100) of such simulations. The probability of ultimate extinction,p(E), may be
estimated as the proportion of simulations that end in extinction. You can also
estimate the mean size of thenth generation from a large number of
simulations. Compare your estimate with the theoretical mean
of (2p)
n
.
Statistical theory shows that the expected value of the extinction probability
p(E) is the smaller of 1, and (1−p)/p.Soforp=0.75,p(E) is expected to be
1/3. But forp≤0.5,p(E) is expected to be 1, which means that extinction is
certain (a rather unexpected result). You can use your script to test this
theory by running it for different values ofp, and estimatingp(E)in
each case.

## None...

While all the colonists living in the English colonies were subjects of the British crown, not all were culturall...

## discuss with your colleagues two health care chall...

Research and discuss with your coll...

## Science : Chemistry....

How many moles of CaCO3 are their in 350g sample?...

## Why in this age of distributed computing centraliz...

Why, in this age of distributed computing, centralized iam systems...

## California State University The Music of Miles Dav...

Question Description Here is the Link to...

## Business Finance : a local government should incr...

How much do you think that a local government should increase taxes in order to fund an interstate highway project?...

## The supervisor-leader debate has resulted in many...

.....you do both effectively at the same time? Assignment is a 500 word response/APA format/ cited & referenced/ non-plagiar...

## Management Information System...

I need someone who is very good with Management Information System. If you are, then contact me...

## Discussion...

According to Kirk (2016), most of your time will be spent working with your data.  The four following group actions were mentioned by...

## what major problem did the roman empire face in th...

what major problem did the...

## Science : describe rocks, geology homework...

describes rocks...

## What am I being asked to believe or accept...

Loony for Luna: What Causes Insane Behavior? (4 points)For centuries, people have believed that the full moon cause...
Calculate Price

When you use PaperHelp, you save one valuable — TIME

You can spend it for more important things than paper writing.

Approx. price
\$65
Order a paper. Study better. Sleep tight. Calculate Price!
Calculate Price
Approx. price
\$65