answer.
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
Vlada
1 month ago
7

Run a Monte Carlo simulation on this vector representing the countries of the 8 runners in this race:

Computers and Technology
1 answer:
zubka84 [1K]1 month ago
4 0

Answer:

Explanation:

# Execute a Monte Carlo simulation 10k times

B <- 10000

results <- replicate(B, {

 winners <- sample(runners, 3)

 (winners[1] %in% "Jamaica" & winners[2] %in% "Jamaica" & winners[3] %in% "Jamaica")

})

mean(results)

You might be interested in
6. Write pseudo code that will perform the following. a) Read in 5 separate numbers. b) Calculate the average of the five number
zubka84 [1067]

Answer:

Pseudo CODE

a)

n= Input “Enter 5 integer values”

b)

sum=0.0

For loop with i ranging from 0 to 5

Inside loop sum=n[i]+sum

Outside loop avg=sum/5

Print avg

c)

small=n[0] # assume initial number is the smallest

large=n[0] # assume initial number is the largest

For loop with i ranging from 0 to 5

Inside loop if n[i]<small # check if current number is smaller than small

Inside if Then small=n[i]

Inside loop if n[i]>large # check if current number is larger than large

Inside if then large=n[i]

Print small

Print large

d)

print avg

print small

print large

8 0
3 months ago
In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
8_murik_8 [964]

Answer:

Below is the month_days function:

def month_days(month, days):

 print (month +" has " + str(days) + " days.")

You can invoke this function with arguments like:

month_days ("June", 30)

month_days("July", 31)

The function can also be restructured as follows:

def month_days(month, days):

 return (month +" has " + str(days) + " days.")

To view the output, call the function along with print like this:

print(month_days ("June", 30))

print(month_days("July", 31))

Explanation:

The defined month_days function takes two parameters: the month name and the number of days in that month. It has a return statement return (month +" has " + str(days) + " days.") which combines the month name held in the variable month with the word "has" and then the number of days stored in days followed by the term days.

For instance, if "June" is passed in as month and 30 as days, the output will be:

June has 30 days.

This program can also be constructed using an f-string for better formatting in the month_days function:

def month_days(month, days):

   output = f"{month} has {days} days."

   return (output)

To see the output, invoke the function with print:

print (month_days("June", 30))

print (month_days("July", 31))

The f-string starts with 'f' and includes the parameters month and days within curly braces. The variables month and days are substituted with their respective values when the function is called.

Screenshot of the program and its output is attached.

6 0
3 months ago
Within a word processing program, predesigned files that have layout and some page elements already completed are called text bo
Harlamova29_29 [1022]
I believe the answer is D. You're welcome:)
7 0
1 month ago
Leah Jones is the IT manager at Rock Solid Outfitters, a medium-sized supplier of outdoor climbing and camping gear. Steve Allen
Natasha_Volkova [1026]

Answer:

Step 1: Create a table reflecting the three potential scenarios and two possible outcomes. There should be a total of 8 distinct rules for the three varying conditions, structured similarly to the discount table shown here in the example: attached is the discount table

Step 2: The rules can now be made simpler by taking the following aspects into account:

a) When a consumer completes the survey form AND opts into the newsletter, according to Rules 1 and 2, they qualify for a discount if their order exceeds $100. This leads to two distinct rules being formulated while the third condition (order quantity) holds significance.

b) If the buyer fills out the survey form OR subscribes to the newsletter, as indicated by Laws 3, 4, 5, and 6, they will benefit from free shipping, regardless of the order amount. As a result, this situation can be divided into two individual rules, where at least one requirement is satisfied, but not both.

c) When a customer fails to meet any requirements, corresponding to Rules 7 and 8, the order value will not qualify for either free shipping or discount. This can be seen as a single law. The linked simplification table illustrates this.

7 0
2 months ago
Other questions:
  • Which of these is an example of the integrity principle that can ensure your data is accurate and untampered with?
    10·2 answers
  • Which of the following type of online advertising intermediaries decide the placement and pricing of online display ads by using
    9·1 answer
  • Until 2015, each new Roblox user automatically had one friend. What was he called?
    12·2 answers
  • 1. Orthographic Drawings are used to express ideas that are more complicated. Explain the purpose of the different views and the
    7·1 answer
  • Suppose that a scheduling algorithm (at the level of short-term CPU scheduling) favors those processes that have used the least
    10·1 answer
  • This question involves a simulation of a two-player game. In the game, two simulated players each start out with an equal number
    7·1 answer
  • 7.7 LAB: Using a while loop countdown Write a program that takes in an integer in the range 10 to 100 as input. Your program sho
    11·1 answer
  • JAVA Write a program that first asks the user to type a letter grade and then translates the letter grade into a number grade. L
    9·1 answer
  • This assignment is based on Exercise 8.4 from your textbook. Each of the following Python functions is supposed to check whether
    11·1 answer
  • Stan’s assignment is to print a three-dimensional image on a piece of paper. Which printing technique should he use?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!