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
What percentage of the soldiers were African American?
nata0808 [166]

Answer:

The percentage of African American soldiers were around 10%.

Explanation:

3 0
2 years ago
Henry Ford was a successful entrepreneur because he
VladimirAG [237]
Henry Ford was the first man to create the concept of the assembly line. This was when every employee was responsible for assembling only one part on Ford's cars. The assembly line was able to ramp up production and turned thousands of cars every month which resulted in more profits for Ford.
6 0
3 years ago
Read 2 more answers
PLEASE HELP ILL GIVE 5 STARS, BRAINLYIST, THANKS, BUT ILL ALSO REPORT IF ANSWER IS WRONG
Digiron [165]

Matching:

1)C; 2)E; 3)D; 4)H; 5)G; 6)F; 7)A; 8)B

Multiple Choice:

9) C

10) B

11) A

12) C

13) C

7 0
2 years ago
Who killed martin king
Elenna [48]

Answer:

James Earl Ray

Explanation:

4 0
3 years ago
The Comanches lived peacefully alongside the __________.
taurus [48]
I haven’t done this in a long time so don’t hold me set on this but if i remember right then it’s between B and D
3 0
2 years ago
Read 2 more answers
Other questions:
  • One example of a civic responsibility that is not a requirement is
    7·2 answers
  • How was life different for many African Americans in the 1950s and 1960s?
    9·1 answer
  • "Theodore c. Sorensen's memorandum, October 18, 1962." List the possible courses of action, including some advantages and disadv
    14·1 answer
  • What economic system was used to reshape China’s economy after the civil war?
    9·1 answer
  • Why did the samurai accept positions in the Meiji government?Government A)positions paid a lot of money.
    11·2 answers
  • Why were the people in early farming communities able to focus on different kinds of work?
    7·2 answers
  • What person played a minor role in the passing of atomic secrets to the Soviets? A. Ethel Rosenberg B. Julius Rosenberg C. David
    13·1 answer
  • In which region is Christianity most widely practiced?
    15·2 answers
  • This is the belief that the United States should have control of all the land in North America
    12·1 answer
  • PLSSS HELPPPP I WILLL GIVE YOU BRAINLIEST!!!!!! PLSSS HELPPPP I WILLL GIVE YOU BRAINLIEST!!!!!! PLSSS HELPPPP I WILLL GIVE YOU B
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!