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]
3 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]3 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
America changes through times of conflict, growth, or peace and cooperation?
chubhunter [2.5K]
American changes through all of these. Times of conflict such as during the Civil War dramatically changed America, times of growth such as during the 1950s dramatically changed America, and times of cooperation, such as during the Civil Rights movement dramatically changed America. 
3 0
3 years ago
Which religious leader founded many convents as a key part of the Counter-Reformation?
lions [1.4K]

Answer:

B

Explanation:

8 0
3 years ago
What are the advantages of parental control over when and to whom a child marries?<br><br>​
Setler79 [48]

Answer:

They can you the relationship to better their political relationships. old Chinese family's would basically sell off their daughters to men from important family's in order to better their standing in society. They would then have better access to more places and resources.

Explanation:

6 0
3 years ago
Why did palmer eventually lose his standing with the American public?
LuckyWell [14K]

Question

<em>why did palmer eventually lose his standing with the American public?</em>

Answer:

<em>Since Palmer sent Hoover to raid any of those people that were Communitsts, Socialists, or Anarchists. The Raid failed and people began to think that Palmer was just looking for a campaign issue to gain suppport for his presidential aspirations. Soon, the public decided that Palmer didn't know what he was talking about.</em>

Hope this helps!

4 0
3 years ago
Why would Southerners support the Mexican American War? 1 point A) They believed it would aid in industrialization. B) They beli
Mrrafil [7]

Answer:

C

Explanation:

7 0
3 years ago
Other questions:
  • Site of the first battle of the revolutionary war
    13·2 answers
  • Why did Hamilton's financial plans favor the North?
    11·1 answer
  • QUESTION 1
    7·1 answer
  • Match the cabinet department with an examples of the duties it performs
    11·2 answers
  • Portugal's Prince Henry sponsored several expeditions to Africa. How did these expeditions contribute to future explorations
    8·2 answers
  • 9. Which of the following correctly identifies the time period of the Middle Ages?
    15·1 answer
  • 1. As a Roman, which of these would you
    5·1 answer
  • What does a country gross domestic product measure
    9·1 answer
  • Why was the Confederation shown to be a failure in the aftermath of the war?
    7·1 answer
  • Once in power, the Bolsheviks changed their party name to the ___________________.
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!