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 and why did native americans particpate in the anerican revilustion
satela [25.4K]

Answer:

During the American Revolution, the majority of American Indian Nations allied themselves with the British in order to preserve their culture and stop encroachment upon their lands. However, some supported the Patriots and their cause because of personal ties, shared religious beliefs, or mistreatment by the British in the past.

Explanation:

3 0
3 years ago
What factors led to the rise of the corporation after 1865?
LuckyWell [14K]
The rise of corporations after 1865 was partially caused by the rising and booming capitalism which saw that very large structures and companies needed a different way of self-organization. For that reason organizations emerged as natural entities. 
5 0
3 years ago
Which statement is most characteristic of George Washington
Dmitry_Shevchenko [17]

Answer:

He established the custom of using the heads of various departments for his personal advisers," since this created the idea of a "cabinet"

3 0
3 years ago
What were the expectations of the British from the Albany Congress in 1754? 1)The British sought the aid of its North American c
VashaNatasha [74]

Answer:

The correct answer is 1) The British sought the aid of their North American colonies to fight the French.

Explanation:

The Albany Congress, held between June 11 - July 11, 1754 in Albany, New York, brought together representatives from seven of the British Thirteen Colonies in North America. The delegates, under the auspices of the British Board of Trade, gathered together to discuss plans regarding the security of the colonies, which had been threatened by the French colony of Canada and their Indian allies.

Relations between Britain and France had been worsening, and <u>the British sought the aid of its North American colonies to fight the French</u>, in what is considered the opening stages of the French and Indian War (1754-1763). As part of the security proposals, Benjamin Franklin presented the Albany Plan, proposing a unified government for the Thirteen Colonies. While the plan was rejected, the Albany Congress and the plan itself left a lasting legacy, as they would become blueprints for the future Continental Congresses and the American Revolutionary War.

7 0
3 years ago
The musician most closely associated with "funk" and encouraging black pride was:
Oxana [17]
The answer would be james brown.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following was a practice by the Aztecs?
    6·1 answer
  • Whose interests did the Democratic Republicans feel government should suppor
    7·2 answers
  • To what extent was the Truman doctrine a sustainable policy
    12·1 answer
  • Why would the act of nullification have weakened the union?
    11·1 answer
  • (7 letter word) Middle Eastern group that helped preserved Europe's classical knowledge.
    12·1 answer
  • Which of these men developed his feelings about human rights during the Enlightenment period? A. George Washington B. Thomas Jef
    9·1 answer
  • Why were Native Americans moved onto smaller and smaller reservations in the 1850's?
    9·2 answers
  • What weapon helped lead to Trench Warfare?<br><br> History
    6·2 answers
  • How did the spread of disease in the Americas contribute to the start of the
    6·1 answer
  • PLZ HELP ASAP ill give brainly Who was successful during the Battle of the Somme? How did new technology impact this battle? Res
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!