1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Llana [10]
4 years ago
4

estion 2. Using a simulation with 10,000 trials, assign num_different to the number of times, in 10,000 trials, that two words p

icked uniformly at random (with replacement) from Pride and Prejudice have different lengths. Hint 1: What function did we use in section 1 to sample at random with replacement from an array? Hint 2: Remember that != checks for non-equality between two items.
Mathematics
1 answer:
aalyn [17]4 years ago
6 0

Answer:

Done using Python programming language

# Python function to simulate 10000 trials for two words to be picked

# Comments are used for explanatory purpose

# Program starts here

Testsword = open('PrideAndPrejudice.txt', encoding='utf-8').

read()

#The following line split the Testword

splitwords = np.array(Testword.split())

In []:

# we'll make use of a temporary variable here. It'll be Initialise to 0

Temp = 0

# Here, the number of trials will be initialised to 0

Init = 10000l0

# Start iteration to search for possible words in PrideAndPrejudice

for count in np.arange(Init):

# search for 2 words

Splitted = np.random.choice(Testword, 2)

#implement the condition in hint above

iflen(Splitted.item(0)) != len(Splitted.item(1)) != len(Spliitem(2)) != len(words.item(0)):

#calcuate result

Temp = Temp + 1

num_different = Temp/Init

You might be interested in
Question Help 2.4.PS-9 The equation P=5s represents the perimeter P of a regular pentagon with side length s. What is the perime
Serjik [45]

Answer:

Perimeter = 15 cm

Step-by-step explanation:

The equation P=5s represents the perimeter P of a regular pentagon with side length s.

We need to find the perimeter of a regular pentagon with side length of 3 cm.

To find it, put s = 3 cm in the given equation.

P = 5(3) cm

= 15 cm

Hence, the perimeter of the regular pentagon of side length 3 cm is 15 cm.

3 0
3 years ago
340 pages;20% decrease show your work
arsen [322]
I think its;
340-20% = 339.8
8 0
4 years ago
Read 2 more answers
Solve the inequality. graph the solution. <br>8a-15&gt;73
Shtirlitz [24]
A=11. to graph it plot an open circle on 11 and go right
8 0
3 years ago
Write the equation of the line that
bulgar [2K]

Answer:

slope=3/7

y-5=3/7(x)

this is the slope intercept form

4 0
2 years ago
British and American spelling are `rigour' and `rigor', respectively. A man staying at a Parisian hotel writes this word, and a
Andrews [41]

Answer:

45.45%

Step-by-step explanation:

Given:

British spelling as "rigour"

here Probability of selecting vowel , P(V/B) =  \frac{\textup{Number of vowels}}{\textup{Total letters}}

or

Probability of selecting vowel , P(V/B) =  \frac{\textup{3}}{\textup{6}} = 0.5

and,

American spelling as "rigor"

here Probability of selecting vowel , P(V/A) =  \frac{\textup{Number of vowels}}{\textup{Total letters}}

or

Probability of selecting vowel , P(V/A) = \frac{\textup{2}}{\textup{5}} = 0.4

Probability of English-speaking men at hotel are British P(B) = 40% = 0.4

Probability of English-speaking men at hotel are American P(A) = 60% = 0.6

Now using Baye's theorem

the probability that the writer is British P(B/V) = \frac{P(B)\times P(V/E)}{P(B)\times P(V/E)+P(A)\times P(V/A)}

or

the probability that the writer is British P(B/V) = \frac{0.4\times0.5}{0.4\times0.5+0.6\times0.4}

or

the probability that the writer is British P(B/V) = \frac{0.2}{0.44}

or

the probability that the writer is British P(B/V) = 0.4545 = 45.45%

6 0
3 years ago
Other questions:
  • Use the graph shown to evaluate the composition <br><br>(f○g)(0)
    8·2 answers
  • Which fraction is equivalent to 2/6?
    12·1 answer
  • a rectangular tabletop measures 4 3/4 feet and an area of 11 7/8 square feet what is the width of the tabletop
    10·2 answers
  • Helpppppppppppppppppppppppppppppppppppppppppppppppppppp
    15·1 answer
  • What does pie equal?
    13·2 answers
  • What was the error in this equation?
    7·1 answer
  • A store sold 2 CDs for every 6 DVDs. If 564 DVDs were sold how many CDs were sold?
    15·1 answer
  • Carmen has 75% less money than Anna. How much money does Carmen have if Anna has 256?
    11·1 answer
  • Use the 3 trig ratios to find each unknown side length. Round all answers to 1 decimal
    12·1 answer
  • Need helppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!