A mathematician is working with a programmer to write a program to solve a problem using high level mathematics. The mathematician asks the programmer to help her determine the efficiency of the algorithm. How can the efficiency be determined?

Answers

Answer 1
Answer:

Answer:

The efficiency of the algorithm can be determined by a measure of amount of time for an algorithm to execute that is time efficiency. Also by a measure of the amount of memory needed for an algorithm to execute: space efficiency. Asymptotic dominance - comparison of cost functions when n is large. That is, g asymptotically dominates f if g dominates f for all "large" values of n.

Step-by-step explanation:

Efficiency of an algorithm means how fast it can produce the correct result for the given problem. The efficiency of an algorithm depends upon its time complexity and space complexity. The complexity of an algorithm is a function that provides the running time and space for data, depending on the size provided by us.

Usually there are natural units for the domain and range of this function. There are two main complexity measures of the efficiency of an algorithm: Time complexity is a function describing the amount of time an algorithm takes in terms of the amount of input to the algorithm.

Algorithm complexity is a measure which evaluates the order of the count of operations, performed by a given or algorithm as a function of the size of the input data. To put this simpler, complexity is a rough approximation of the number of steps necessary to execute an algorithm.

Steps to analyze an algorithm:

- Implement the algorithm completely.

- Determine the time required for each basic operation.

- Identify unknown quantities that can be used to describe the frequency of    execution of the basic operations.

- Develop a realistic model for the input to the program.


Related Questions

The conversion of square feet to square yards can be represented by direct variation. Three square yards are equivalent to 27 square feet. Let y represent the number of square yards and x the number of square feet. Then y varies directly with x.What is the constant of variation?
What is the simplified form of each expression? 1/3(21m + 27)
A rectangle has a length of the fifth root of 16 inches and a width of 2 to the 1 over 5 power inches. Find the area of the rectangle.
Write a function perim that receives the radius r of a circle and calculates and returns the perimeter p of the circle (p = 2 * π * r). a) def perim(r): b) perim(r): c) def perim_circle(r): d) def calculate_perimeter(r):
A certain been plant grows 15% in height each day. Today after 10 days it is 27 inches tall. How tall was it yesterday?

Jordan likes only blue jelly beans. He has a box of 100 jelly beans that contains equal numbers of red, blue, green, yellow, and orange jelly beans.Jordan randomly pulls out a jelly bean. Then he pulls out a second one without replacing the first. What is the probability that both jelly
beans are blue?

Answers

2/20 is the chance of choosing 2 blue jelly beans. Since there are 5 colors, that are equally divided......

At a constant rate of flow, it takes 20 minutes to fill a swimming pool if a large hose is used and 30 minutes if a small hose is used. At these constant rates, how many minutes will it take to fill the pool when both hoses are used simultaneously?

Answers

Answer: 12 minutes

Step-by-step explanation:

This is a standard Work Formula question (2 or more 'entities' that work on a task together). When there are just 2 entities and there are no 'twists' to the question, we can use the Work Formula to get to the correct answer.

Work = (A)(B)/(A+B) where A and B are the individual times needed to complete the task.

We're told that two hoses take 20 minutes and 30 minutes, respectively, to fill a pool. We're asked how long it takes the two hoses, working together, to fill the pool.

(20)(30)/(20+30) = 600/50 = 12 minutes to fill the pool.

What is the inverse of the function f(x) = x +3?A. h(x) =1/3 x + 3
B. h(x) = 1/3x – 3
C. h(x) = x – 3
D. h(x) = x + 3

Answers

Answer:

Option C is correct that is h(x)=x-3

Step-by-step explanation:

We have been given a function:

f(x)=x=3

\text{let y}=f(x)

y=x+3

x=y-3

Hence,f^(-1)y=y-3

Therefore, f^(-1)x=x-3

Hence, Option C is correct that is h(x)=x-3

f(x) = x + 3
y = x + 3
x = y - 3

Inverse is h(x) = x - 3

The equation D=13/v shows that the density of a particular substance equals a mass of 13 grams divided by the volume of the substance. What happens to the density as the volume approaches 0?The density approaches infinity.
The density approaches 0.
The density approaches 1.
The density approaches 13.

Answers

D = 13/v

What happens to the density as the volume approaches 0?

The density approaches 13.

Assume : V = 3 ; V = 2 ; V = 1

D = 13/3 = 4.33
D = 13/2 = 6.50
D = 13/1 = 13

Answer:

Option A is correct

The density approaches infinity.

Step-by-step explanation:

Given the equation:

D = (13)/(v)               ....[1]

where,

D is density of a particular substance .

v is the volume of the substance.

We have to find What happens to the density as the volume approaches 0.

As the volume approaches to 0

v \rightarrow 0

[1] ⇒

D \rightarrow \infty

⇒The density approaches infinity.

Therefore, the density as the volume approaches 0 is,  infinity.

Ou have learned that given a sample of size n from a normal distribution, the CL=95% confidence interval for the mean can be calculated by Sample mean +/- z((1-CL)/2)*Sample std/sqrt(n). Where z((1-cl)/2)=z(.025) is the z score.a. help(qnorm) function. Use qnorm(1-.025) to find z(.025).
b. Create a vector x by generating n=50 numbers from N(mean=30,sd=2) distribution. Calculate the confidence interval from this data using the CI formula. Check whether the interval covers the true mean=30 or not.
c. Repeat the above experiments for 200 times to obtain 200 such intervals. Calculate the percentage of intervals that cover the true mean=30. This is the empirical coverage probability. In theory, it should be very close to your CL.
d. Write a function using CL as an input argument, and the percentage calculated from question c as an output. Use this function to create a 5 by 2 matrix with one column showing the theoretical CL and the other showing the empirical coverage probability, for CL=.8, .85, .9, .95,.99.

Answers

a. To find the z score for a given confidence level, you can use the `qnorm()` function in R. The `qnorm()` function takes a probability as an argument and returns the corresponding z score. To find the z score for a 95% confidence level, you can use `qnorm(1-.025)`:

```R
z <- qnorm(1-.025)
```

This will give you the z score for a 95% confidence level, which is approximately 1.96.

b. To create a vector `x` with 50 numbers from a normal distribution with mean 30 and standard deviation 2, you can use the `rnorm()` function:

```R
x <- rnorm(50, mean = 30, sd = 2)
```

To calculate the confidence interval for this data, you can use the formula:

```R
CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
```

This will give you the lower and upper bounds of the 95% confidence interval. You can check whether the interval covers the true mean of 30 by seeing if 30 is between the lower and upper bounds:

```R
lower <- CI[1]
upper <- CI[2]
if (lower <= 30 && upper >= 30) {
 print("The interval covers the true mean.")
} else {
 print("The interval does not cover the true mean.")
}
```

c. To repeat the above experiment 200 times and calculate the percentage of intervals that cover the true mean, you can use a for loop:

```R
count <- 0
for (i in 1:200) {
 x <- rnorm(50, mean = 30, sd = 2)
 CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
 lower <- CI[1]
 upper <- CI[2]
 if (lower <= 30 && upper >= 30) {
   count <- count + 1
 }
}
percentage <- count / 200
```

This will give you the percentage of intervals that cover the true mean.

d. To write a function that takes a confidence level as an input and returns the percentage of intervals that cover the true mean, you can use the following code:

```R
calculate_percentage <- function(CL) {
 z <- qnorm(1-(1-CL)/2)
 count <- 0
 for (i in 1:200) {
   x <- rnorm(50, mean = 30, sd = 2)
   CI <- mean(x) + c(-1, 1) * z * sd(x) / sqrt(length(x))
   lower <- CI[1]
   upper <- CI[2]
   if (lower <= 30 && upper >= 30) {
     count <- count + 1
   }
 }
 percentage <- count / 200
 return(percentage)
}
```

You can then use this function to create a 5 by 2 matrix with one column showing the theoretical CL and the other showing the empirical coverage probability:

```R
CL <- c(.8, .85, .9, .95, .99)
percentage <- sapply(CL, calculate_percentage)
matrix <- cbind(CL, percentage)
```

This will give you a matrix with the theoretical CL in the first column and the empirical coverage probability in the second column.

Know more about z score here:

brainly.com/question/15016913

#SPJ11

F(x) = 3x - 3
g(x) = 4x + 5

find (f+g) (3)

Answers

Answer:

23

Step-by-step explanation:

(f + g)(3) = f(3) + g(3)

f(3) = 3(3) - 3 = 9 - 3 = 6

g(3) = 4(3) + 5 = 12 + 5 = 17

Then

(f + g)(3) = 6 + 17 = 23