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
After America defeated Mexico, two significant results were
densk [106]
D) They gained California and New Mexico
6 0
3 years ago
Read 2 more answers
Question 1
Ede4ka [16]
All of them are good answers but it would have to be the second quote because it gave them access to trade with China and they don’t have to fight over who gets to trade with China
6 0
3 years ago
What are the three phases of matter?<br><br> The three phases of matter are solids liquid and gases.
m_a_m_a [10]

Answer:

the answer is true

solids liquid and gas is three phases of matter

8 0
2 years ago
Read 2 more answers
How does the fifth amendment relate tonthe decision of miranda v. arizona
snow_lady [41]
Miranda v. Arizona was the reason that the fifth amendment was put into place. The fifth amendment states that people cannot be subjected to capital punishment without their rights being read to them and that's how we got the Miranda rights. 
3 0
2 years ago
Read 2 more answers
What increased trade with Western Europe?
EleoNora [17]

Answer:the competition for trade

Explanation:

5 0
3 years ago
Other questions:
  • Which was the conqueror of the Incas in South America?
    10·2 answers
  • Select the items that describe the results of a scarcity
    13·1 answer
  • 1. The purpose of antitrust laws is to
    6·2 answers
  • Name the 3 important social groups and describe each one
    15·1 answer
  • Question 1 (1 point) 
    7·1 answer
  • HELPPPPPP PLEASEEEEE ILL GIVE BRAINLIEST AND POINTSSSS
    10·1 answer
  • Have this done correctly for brainliest​
    15·1 answer
  • Which diagram best matches the civilization with its form of goverment?
    8·1 answer
  • Which is in the correct order? A. Bill becomes a law. B. Law becomes a bill
    7·2 answers
  • At yalta, the leaders agreed to recognize the polish government that the soviets had set up if stalin agreed to:
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!