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
How did Philadelphia shape america at the turn of the 20th century?
andreyandreev [35.5K]
<span>American people benefited from industrial growth while also experiencing its adverse effects. Cheap labor and assembly-line manufacturing made mass production possible. Railroad networks carried the mass-produced goods, of new technologies, around the country. retailers expanded their operations and laid the foundation for the consumer-driven society that evolved later in the century. Materially, city dwellers' standards of living improved steadily, not only in food, shelter, housing, and other material goods, but also in health care and education. Inexpensive books, magazines, newspapers, and improved public libraries, funded in part through the benevolence of Andrew Carnegie, contributed to their intellectual lives. Sexual fulfillment in marital relationships continued to gain importance, and family life increasingly reflected the ideals of companionship. Silent films and amateur and professional sports helped fill leisure time. The Boy Scouts and Girl Scouts, founded in 1908 and 1910, provided recreational and educational opportunities for children.</span>
3 0
3 years ago
Kung walang tiyaga,<br>Walang Nilaga​
RoseWind [281]

Answer:

what language is this?

Explanation:

7 0
3 years ago
Read 2 more answers
What was one result of the cuban missile crisis?
sergiy2304 [10]
C. Khrushchev was pushed out of power two years later because of his appeared weakness. Castro said he backed down, while Soviet hardliners were upset.
8 0
2 years ago
Why did pontiac lead a rebellion against the British following the french and indian war?
mezya [45]
Pontiac lead a rebellion against british following the french and indian war because the british created several policies that offended the tribes, because they keep taking the tribe's land and power, causing them to feel dishonored by the colonies

hope this helps
8 0
3 years ago
Read 2 more answers
What did the Treaty of Versailles mean for Germany and for Europe?
Kryger [21]


For Germany the treat of Versailles dealt them a heavy hand. They were imposed land, economic and military restraints as well as forced to pay a great deal of the reparations cost for countries like France. Whom during world war one had received heavy damages.

More specific on territory, Germany's land were split between different nations. Such as the Rhineland  which they were prohibited from occupying after losing the war.

Hope it somewhat helps :)

6 0
3 years ago
Other questions:
  • What was the name given to states between the north and the south that had to choose whether to secede or stay in the union?
    9·1 answer
  • What party did thomas jefferson found and what did they believe
    12·1 answer
  • A well regulated Militia, being necessary to the security of a free State, the right of the people to keep and bear Arms, shall
    15·1 answer
  • What about the hebrew people made their religion unique incomparison to other ancient civilization
    10·1 answer
  • 20-word summary of "What was the role of the U.S. in the Iran-Contra Affair?"
    11·1 answer
  • Hitler’s invasion of the in June 1941 proved that he would consistently break agreements.
    9·2 answers
  • Explain the effectiveness of the organization tactics of the Mongol army
    13·1 answer
  • A result of the publication of Rachel Carson's Silent Spring (1962) was the
    15·2 answers
  • What notable literary figure spent 10 years researching and writing a dictionary?
    10·1 answer
  • which was a result of the battle of the little big horn? general william sherman defeated the apaches under geronimo and forced
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!