Answer:
import numpy as np
def sample_median(n, P):
return np.median( np.random.choice ( np.arange (1, len(P) + 1 ), n, p = P ) )
print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2]))
print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2]))
print(sample_median(5, [0.3,0.7])
print(sample_median(5, [0.3,0.7])
Explanation:
- Bring in the numpy library to use the median function provided by the numpy library.
- Define the sample_median function that takes in 2 parameters and returns the median with the help of built-in random, choice and arrange functions.
- Call the sample_median function by providing some values to test and then display the results.
Output:
4.5
4.0
2.0
1.0
Answer:
Answered below
Explanation:
# Program is written in Python programming language
conditioner_in_ml = 0
width = float(input("Enter width in inches: "))
height = float(input("Enter height in inches: "))
length = float (input("Enter length in inches: "))
#Calculate the volume
volume = width * length * height
#Calculate the amount of conditioner per 100 #cubic inches of volume
conditioner_in_ml = volume/ 100
print("The amount of conditioner required for $volume cubic inches is $conditioner_in_ml ml")
Answer:
the answer is a.they rely on airwaves for broadcasting
Explanation:
i just took this test on brainly
This medium is called Animation. Animation is a medium where images are handled to appear as moving pictures. In traditional animation, images are drawn or painted by hand on transparent celluloid sheet, so as to be photographed and exhibited on film. Today most animations are made with computer-generated imagery (CGI).
Answer:
for(int i =0; i<yearlySalesTotals.length;i++)
Explanation:
The for statement in has the syntax as given above, it has an int variable indicating the starting index, then a boolen condition ensuring that you don't get out of the array bounds, and an increment operator.
See below a complete program in java that will output all elements of the array assuming the array yearlySalesTotals contains only ten elements and all indexes has been assigned values.
public class ANot {
public static void main(String[] args) {
double []yearlySalesTotals = new double[10];
for(int i = 0; i<yearlySalesTotals.length; i++){
System.out.println(yearlySalesTotals[i]);
}
}
}