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
The "shogunate system" was established by
padilas [110]
The samurai leader minamoto yoritomo
7 0
3 years ago
What do you think people today can learn from the long-term results of the treaty of versailles?
sleet_krkn [62]
The lesson is that not to take punishment to an extreme,or that harsh punishment is not the ideal way to solve a conflict,as it might backfire.

After WWI,Germany was punished harshly for starting the war by supporting Austria-Hungary. The punishment involved was to pay a great war dept of 33 billions, disarming(no air craft allowed,reduced army to 100000 men etc.) . It has caused much problem to the nation such as hyperinflation, unemployment etc.

This finally led to the up-rise of totalitarianism, in which the nation become aggressive in order to get national glory, and many jews were killed in blame of hindering Germany's development the or even leading to her defeat. It finally post a world threat and caused the outburst of WWII. If the punishment was not as harsh, totalitarianism could be avoided as well as WWII. Thus the lesson is that not to push the matter too hard and be more lenient
5 0
3 years ago
Use the following image to answer the question.
Kitty [74]

Answer:

Option D

Explanation:

The U.S. Supreme Court in Washington, D.C., represented by section D.

;)

6 0
3 years ago
Read 2 more answers
Why did having Soviet Union as an ally contradict one of the reasons for the United States involvement in the war?
xeze [42]

Answer:

Si

Explanation:

8 0
3 years ago
Read 2 more answers
1. Which states joined the Confederate States of America?
aliya0001 [1]

Answer:

Virginia, Arkansas, Tennessee, and North Carolina

4 0
4 years ago
Other questions:
  • The animal featured on the first california flag was a(n) ______.
    13·1 answer
  • How does gabriel's rebellion compare to the uprising in saint domingue?
    8·1 answer
  • Congress established the Reconstruction Finance Corporation (RFC) to loan money to what?
    9·2 answers
  • Between 1880 and 1900 why did most immigrants that came to the United States settle in cities ?
    8·1 answer
  • Help me please I don’t now what is the answer please
    11·1 answer
  • How was the southeastern part of Louisiana formed
    12·1 answer
  • in the Chinese civil service examination system a. the system entirely eliminated aristocratic influence in the government burea
    10·1 answer
  • What impact was the transcontinental railroad designed to have on the West?
    15·2 answers
  • How did the French treat Native Americans
    9·1 answer
  • How did most African Americans live in the North?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!