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
Who was the flappers?
oee [108]

Flappers were a generation of young Western women in the 1920s who wore short skirts, bobbed their hair, listened to jazz, and flaunted their disdain for what was then considered acceptable behavior.

3 0
4 years ago
In a paragraph, explain the effects of imperialism on colonized nations.
Lelechka [254]

Answer:

no thanks

Explanation:frggtgtgthtgt

4 0
3 years ago
When did spain come into existence?
tigry1 [53]

Answer: 1492

Explanation: The Christian Kingdoms of Castile and Aragon conquer the Emirate of Granada, ending nearly 800 years of Muslim rule in the south and founding modern Spain as a united state.

6 0
2 years ago
Where did the first daily newspaper start?
Zina [86]
Number 1.is the correct answer I attached a screenshot that explains about it I hope you can see it!

8 0
3 years ago
Read 2 more answers
please help: Lyndon Johnson signed the Civil Rights Act of 1964. Which groups were affected by this piece of legislation? all ra
zlopas [31]
It was "all racial minorities" that were affected when Lyndon Johnson signed the Civil Rights Act of 1964, which forbade discrimination in the US based on race or creed.
3 0
4 years ago
Other questions:
  • why were people in spain, france and england ready for a new approach in government in the 15th century
    5·1 answer
  • which of the following best describes why Islam is an important religion in many parts of North Africa today
    14·1 answer
  • One major development that was key to the second industrial revolution was the development of
    15·1 answer
  • The _________ amendment to the u.s. constitution appeared to guarantee equal rights for blacks.
    6·2 answers
  • There was a little difference in the Spartan society between the rights given to a slave and those given to a
    6·1 answer
  • Became known as Molly Pitcher for bringing the soldiers water while under fire. She too would take her husband’s place at a cann
    11·1 answer
  • In the lesson, African Americans of the 1800s were described this way: "That African Americans were neither humbled nor crushed
    6·1 answer
  • PLEASE TELL ME AM I THE ONLY PERSON THAT THINKS FRODO BAGGINS IS ATTRACTIVE AHHAHA
    11·2 answers
  • 5 questions about Transcendentalism please?
    9·1 answer
  • Outline the changes the National Socialist Party brought to Germany.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!