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
Alinara [238K]
2 years ago
7

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

picked 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.
History
1 answer:
Olegator [25]2 years ago
7 0

Answer:

This simulation will be done using Python programming language

# Program is written in Python

# Comments are used for explanatory purpose

# Program starts here

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

read()

#Split words

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

In []:

# Initialise trial simulation to 10000 in test variable

test = 10000

# Initialise diff to 0

diff = 0

# iterate for possible words in PrideAndPrejudice

for i in np.arange(test):

# search for 2 words

words = np.random.choice(splitwords, 2)

#implement the condition in hint above

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

#calcuate result

diff = diff + 1

num_different = diff/test

You might be interested in
Who are the only people allowed out of the camp on the night of the riot? the reservoir crew the camp officers children under ag
madreJ [45]
<span>the reservoir crew

Hope this helps !</span>
3 0
3 years ago
When did Christopher Columbus discover america​
Otrada [13]

Answer:

Discovered in August 3rd, 1492!

6 0
3 years ago
Read 2 more answers
Please and think I was any help with this so please and help me
melomori [17]
D would be the best answer. The larger hammer would have a greater mass indeed. So it would creat more friction between the nail and the hammer creating more force being applied to the nail. Therefore the nail being able to go into the wood.
5 0
2 years ago
Which president was the first to openly campaign using Twitter as a source? A. Barack Obama B. Donald Trump C. George W. Bush​
omeli [17]

Answer:

B is the answer

Explanation:

5 0
3 years ago
Read 2 more answers
Which beliefs did the Sumerians hold?
shtirl [24]

Answer: The answer is D.

Explanation:

D. Powerful gods controlled everything.

5 0
3 years ago
Other questions:
  • The 1847 Ten-Hour Act stated that _____ could only work up to ten hours a day.
    15·2 answers
  • When religious leaders such as James thornwell and Albert Barnes wrote about slavery what did they base their views on
    9·1 answer
  • Who was Abott Suger?
    12·2 answers
  • What influence did the proposed Thirteenth Amendment have on peace talks between the Union and the Confederacy?
    7·2 answers
  • Which statement describes the power that Congress
    6·2 answers
  • What natural disaster plagues Peru, the Andes mountains and the area where the Inca once inhabited?
    15·1 answer
  • Annas was also a political leader in Jerusalem.<br> True<br> False
    15·2 answers
  • In what year were women given the right to vote in the united states?
    7·1 answer
  • Which statement is true of Native Americans in the late 1700s and early 1800s?
    13·2 answers
  • The recent recessions in the US have been referred to as jobless recoveries. What factors allow for, or contribute to, a jobless
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!