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
Whose ideas are most closely associated with the term "dictatorship of the proletariat"?
Ira Lisetskai [31]
These ideas are most closely associated with Marx and Lenin, whose philosophies about socialism as an alternative to capitalism inspired the Russian Revolution. 
4 0
3 years ago
Read 2 more answers
A __________ court martial handles charges of minor misconduct.
Lemur [1.5K]
A (summary) court martial handles charges of minor misconduct
5 0
4 years ago
Which states in Latin America gained their independence from European powers in the 1800's?
xxTIMURxx [149]
These are some of the states that gained their independence 
MexicoHaitiColombiaVenezuelaBrazil
5 0
4 years ago
President Bush’s approval rating fell at the end of his presidency in part because he
frez [133]

Answer:

D on Edge, "broke his promise not to raise new taxes."

Explanation:

I got 100% on the quiz

4 0
3 years ago
Read 2 more answers
Lawyers must pass a what ??
Veseljchak [2.6K]

All lawyers must pass their state's bar exam to practice.

4 0
3 years ago
Read 2 more answers
Other questions:
  • Anyone taking World History B that can help me Ill give Brainliest 5 stars and thank you if you can!
    6·1 answer
  • Many more people would vote if they believed:
    12·2 answers
  • What problems did people have with womens suffrage?
    12·1 answer
  • Why do we know so little about primitive tribes
    7·1 answer
  • Which empire is best known for
    8·2 answers
  • Which letter on the map indicates the location of the Danube River?
    5·1 answer
  • In what way was reconstruction successful?
    8·2 answers
  • Who were the normans
    11·1 answer
  • Which political group were Nazi's a part of? *<br> Fascist<br> Democrat<br> Communist
    11·1 answer
  • Plssss help me I will make you brain
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!