Answer:
1.25
Explanation:
#instructions =
Average CPI (old) = 0.2*6 + 0.8*1 = 1.2+0.8 = 2.0
Average CPI (new) = 0.2*12 + 0.8*1 = 2.4 + 0.8 = 3.2
Assuming Clock Rate = x
Speedup = Execution Time (old) / Execution time (new) = (2.0*5*
/x) / (3.2*5*
/2x) = 4/3.2 = 1.25
Answer:
import java.util.Arrays;
import java.util.Scanner;
public class num1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter length of the array:");
int len = in.nextInt();
double [] temps = new double[len];
double avgTem;
int k =0;
double total = 0;
for( k=0; k<temps.length; k++){
System.out.println("Enter values for the array");
temps[k]=in.nextDouble();
}
System.out.println("The Arrays contains the following values");
System.out.println(Arrays.toString(temps));
// Computing the average of the values
for(k=0; k<temps.length; k++){
total = total+temps[k];
}
avgTem = total/(temps.length);
System.out.println("The average Temperature is: "+avgTem);
}
}
Explanation:
- Using Java programming language
- Import the Scanner class to receive user input
- Prompt User for the length of the Array, receive and store in a variable len;
- Declare a new double array of size len double [] temps = new double[len];
- Using a for loop, continually prompt user to enter values into the array
- Display the values of the array using Java's Arrays.toString method
- Use another for loop to add up all the elements in the arraay and store in the variable called total
- Outside the second for loop calculate the average avgTem = total/(temps.length);
- Display the average temp.
Answer:
Below is code written in a free CAS (WxMaxima):
The above code creates the probability of 19 or more brown in the sample of 48 for population sizes from 5*19 to 10000 in steps of 5.
Here’s a plot of that data:
The horizontal blue line is the probability for an infinite population size (or, choosing each of the 48 M&Ms with replacement, which I infer is not what you meant). It is calculated using the binomial cdf:
The red curve approaches the blue line asymptotically as the population gets larger.
At population 10000, the red curve is
.