All Matches
Solution Library
Expert Answer
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Tutors
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Study Help
New
Search
Search
Sign In
Register
study help
mathematics
statistics
Questions and Answers of
Statistics
Describe an algorithm that takes as input a list of n integers and finds the location of the last even integer in the list or returns 0 if there are no even integers in the list.
A palindrome is a string that reads the same forward and backward. Describe an algorithm for determining whether a string of n characters is a palindrome
Establish a big-O relationship, find witnesses C and k such that |f (x)| ≤ C|g(x)| whenever x > k.Determine whether each of these functions is O(x).a) f (x) = 10 b) f (x) = 3x + 7c) f (x) = x2 +
Show that 3x4 + 1 is O(x4/2) and x4/2 is O (3x4+1).
Show that 2n is O(3n) but that 3n is not O(2n). (Note that this is a special case of Exercise 60.)
Determine whether x3 is O(g(x)) for each of these functions g(x). a) g(x) = x2 b) g(x) = x3 c) g(x) = x2 + x3 d) g(x) = x2 + x4 e) g(x) = 3x f ) g(x) = x3/2
Suppose that f (x), g(x), and h(x) are functions such that f (x) is O(g(x)) and g(x) is O(h(x)). Show that f (x) is O(h(x)).
Determine whether each of the functions 2n+1 and 22n is O(2n).
Arrange the functions √n, 1000 log n, n log n, 2n!, 2n, 3n, and n2 / 1,000,000 in a list so that each function is big-O of the next function.
Suppose that you have two different algorithms for solvinga problem. To solve a problem of size n, the first algorithm uses exactly n(log n) operations and the second algorithm uses exactly n3/2
Give as good a big-O estimate as possible for each of these functions. a) (n2 + 8)(n + 1) b) (n log n + n2)(n3 + 2) c) (n! + 2n)(n3 + log(n2 + 1))
Give a big-O estimate for each of these functions. For the function g in your estimate that f (x) is O(g(x)), use a simple function g of the smallest order.a) n log(n2 + 1) + n2 log nb) (n log n +
For each function in Exercise 2, determine whether that function is (x2) and whether it is (x2).
Use the definition of "f (x) is O(g(x))" to show that x4 + 9x3 + 4x + 7 is O(x4).
Show that f (x) is (g(x)) if and only if f (x) is O(g(x))and g(x) is O(f (x)).
Show that if f (x) and g(x) are functions from the set of real numbers to the set of real numbers, then f (x) is (g(x)) if and only if there are positive constants k, C1, and C2 such that C1 |g(x)|
Express the relationship f (x) is (g(x)) using a picture. Show the graphs of the functions f (x), C1|g(x)|, and C2|g(x)|, as well as the constant k on the x-axis.
Explain what it means for a function to be (1).
Show that if f and g are real-valued functions such thatf (x) is O(g(x)), then for every positive integer n, f n(x) is O(gn(x)).
Suppose that f (x) is O(g(x)) where f and g are increasing and unbounded functions. Show that log |f (x)| is O(log |g(x)|).
Let f1(x) and f2(x) be functions from the set of real numbers to the set of positive real numbers. Show that if f1(x) and f2(x) are both (g(x)), where g(x) is a function from the set of real numbers
If f1(x) and f2(x) are functions from the set of positive integers to the set of positive real numbers and f1(x) and f2 (x) are both (g(x)), is (f1 f2)(x) also (g(x))? Either prove
Find functions f and g from the set of positive integers to the set of real numbers such that f (n) is not O(g(n)) and g(n) is not O(f (n)).
Show that if f1(x) is (g1 (x)), f2 (x) is (g2 (x)), and f2 (x) = 0 and g2 (x) 0 for all real numbersx > 0, then (f1 / f2)(x) is ((g1/g2)(x)).
Show that (x2 + 1) / (x + 1) is O(x).
Define the statement f (x, y) is (g(x, y)).
Show that (x2 + xy + x log y)3 is O(x6y3).
Show that is O(xy).
Show that if c > d > 0, then nd is O(nc), but nc is not O(nd).
Show that if d is positive and b > 1, then nd is O(bn) but bn is not O(nd).
Show that a) x2 is o(x3). b) x log x is o(x2). c) x2 is o(2x ). d) x2 + x + 1 is not o(x2).
Represent pictorially that x log x iso (x2) by graphing x log x, / x2, and x log x/x2. Explain how this picture shows that x log x is o(x2).
Suppose that f (x) is o(g(x)). Does it follow that 2f (x) is o(2g(x))?
The two parts of this exercise describe the relationship between little-o and big-O notation. a) Show that if f (x) and g(x) are functions such that f (x) is o(g(x)), then f (x) is O(g(x)). b) Show
Show that if f1(x) is O(g(x)) and f2(x) is o(g(x)), then f1(x) + f2 (x) is O(g(x)).
Find the least integer n such that f (x) is O(xn) for each of these functions.a) f (x) = 2x3 + x2 log xb) f (x) = 3x3 + (log x)4c) f (x) = (x4 + x2 + 1)/(x3 + 1)d) f (x) = (x4 + 5 log x)/(x4 + 1)
Show that n log n is O(log n!).
Show that log n! is greater than (n log n)/4 for n > 4. Let f (x) and g(x) be functions from the set of real numbers to the set of real numbers. We say that the functions f and g are asymptotic and
For each of these pairs of functions, determine whether f and g are asymptotic.a) f (x) = log(x2 + 1), g(x) = log xb) f (x) = 2x+3, g(x) = 2x+7c) f (x) = 22x, g(x) = 2x2d) f (x) = 2x2 + x+1, g(x) =
Show that x2 + 4x + 17 is O(x3) but that x3 is not O(x2 + 4x + 17).
Give a big-O estimate for the number of operations (where an operation is an addition or a multiplication) used in this segment of an algorithm. t := 0 for i := 1 to 3 for j := 1 to 4 t := t + ij
a) Suppose we have n subsets S1, S2, . . . , Sn of the set {1, 2, . . . , n}. Express a brute-force algorithm that determines whether there is a disjoint pair of these subsets. b) Give a big-O
The conventional algorithm for evaluating a polynomial anxn + an−1xn−1 +· · ·+a1x + a0 at x = c can be expressed in pseudocode by procedure polynomial(c, a0, a1, . . . , an: real
What is the largest n for which one can solve within one second a problem using an algorithm that requires f (n) bit operations, where each bit operation is carried out in 10−9 seconds, with these
How much time does an algorithm using 250 operations need if each operation takes these amounts of time? a) 10−6 s b) 10−9 s c) 10−12 s
Analyze the average-case performance of the linear search algorithm, if exactly half the time the element x is not in the list and if x is in the list it is equally likely to be in any position.
Describe the worst-case time complexity, measured in terms of comparisons, of the ternary search algorithm described in Exercise 27 of Section 3.1.
Analyze the worst-case time complexity of the algorithm you devised in Exercise 29 of Section 3.1 for locating a mode in a list of nondecreasing integers.
Analyze the worst-case time complexity of the algorithm you devised in Exercise 31 of Section 3.1 for finding the first term of a sequence of integers equal to some previous term.
Analyze the worst-case time complexity of the algorithm you devised in Exercise 33 of Section 3.1 for finding the first term of a sequence less than the immediately preceding term.
Determine the worst-case complexity in terms of comparisons of the algorithm from Exercise 9 in Section 3.1 for determining whether a string of n characters is a palindrome.
Find a big-O estimate for the worst-case complexity in terms of number of comparisons used and the number of terms swapped by the binary insertion sort described in the preamble to Exercise 47 in
Find the complexity of a brute-force algorithm for scheduling the talks by examining all possible subsets of the talks.
Describe how the number of comparisons used in the worst case changes when these algorithms are used to search for an element of a list when the size of the list doubles from n to 2n, where n is a
From the definition of the matrix product, describe an algorithm in English for computing the product of two upper triangular matrices that ignores those products in the computation that are
How many multiplications of entries are used by the algorithm found in Exercise 41 for multiplying two n × n upper triangular matrices?
What is the best order to form the product ABCD if A, B, C, and D are matrices with dimensions 30 × 10, 10 × 40, 40 × 50, and 50 × 30, respectively?.
How many comparisons are used by the algorithm given in Exercise 16 of Section 3.1 to find the smallest natural number in a sequence of n natural numbers?
Suppose that an element is known to be among the first four elements in a list of 32 elements. Would a linear search or a binary search locate this element more rapidly?
Give a big-O estimate for the number of comparisons used by the algorithm that determines the number of 1s in a bit string by examining each bit of the string to determine whether it is a 1 bit (see
a) Define the term algorithm. b) What are the different ways to describe algorithms? c) What is the difference between an algorithm for solving a problem and a computer program that solves this
a) State the definition of the fact that f (n) is O(g(n)), where f (n) and g(n) are functions from the set of positive integers to the set of real numbers. b) Use the definition of the fact that f
a) How can you produce a big-O estimate for a function that is the sum of different terms where each term is the product of several functions? b) Give a big-O estimate for the function f (n) = (n! +
a) Define what the worst-case time complexity, average case time complexity, and best-case time complexity (in terms of comparisons) mean for an algorithm that finds the smallest integer in a list of
Is one of these algorithms always faster than the other (measured in terms of comparisons)?
Use the bubble sort algorithm to sort the list 5, 2, 4, 1, 3.
Use the insertion sort algorithm to sort the list 2, 5, 1, 4, 3.
a) Describe an algorithm for locating the last occurrence of the largest number in a list of integers. b) Estimate the number of comparisons used.
Show the steps used by the shaker sort to sort the list 3, 5, 1, 4, 6, 2. The shaker sort (or bidirectional bubble sort) successively compares pairs of adjacent elements, exchanging them if they are
Show that the shaker sort hasO(n2) complexity measured in terms of the number of comparisons it uses.
Show that (n log n + n2)3 is O(n6).
Find all pairs of functions of the same order in this list of functions: n2 + (log n)2, n2 + n, n2 + log 2n + 1, (n + 1)3 − (n − 1)3, and (n + log n)2.
Find an integer n with n > 2 for which n2100 < 2n.
Arrange the functions nn, (log n)2, n1.0001, (1.0001)n, 2√log2 n, and n(log n)1001 in a list so that each function is big-O of the next function.
Give an example of two increasing functions f (n) and g(n) from the set of positive integers to the set of positive integers such that neither f (n) is O(g(n)) nor g(n) is O(f (n)).
a) Use pseudocode to specify a brute-force algorithm that determines when given as input a sequence of n positive integers whether there are two distinct terms of the sequence that have as sum a
a) Give an algorithm to determine whether a bit string contains a pair of consecutive zeros. b) How many comparisons does the algorithm use?
Find all valid partners for each man and each woman if there are three men m1, m2, and m3 and three women w1, w2, w3 with these preference rankings of the men for the women, from highest to lowest:
Define what it means for a matching to be female optimal and for a matching to be male pessimal.
In this exercise we consider matching problems where there may be different numbers of men and women, so that it is impossible to match everyone with a member of the opposite gender. a) Extend the
Suppose we have five jobs with specified required times and deadlines: t1 = 25, d1 = 50; t2 = 15, d2 = 60; t3 = 20, d3 = 60; t4 = 5, d4 = 55; t5 = 10, d5 = 75. Find the maximum lateness of any job
Find an example that shows that scheduling jobs in order of increasing time required does not always yield a schedule with the smallest possible maximum lateness.
Suppose that we have a knapsack with total capacity of W kg. We also have n items where item j has mass wj. The knapsack problem asks for a subset of these n items with the largest possible total
Suppose that L∗ is the minimum makespan when p processors are given n jobs, where tj is the time required to run job j. a) Show that L∗ ≥ max j = 1,2,...,n tj. b) Show that L∗ ≥ 1/p Σnj=1
Run the algorithm from Exercise 44 on the input given in Exercise 42. In exercise 42 Suppose we have three processors and five jobs requiring times t1 = 3, t2 = 5, t3 = 4, t4 = 7, and t5 = 8. Solve
a) Adapt Algorithm 1 in Section 3.1 to find the maximum and the minimum of a sequence of n elements by employing a temporary maximum and a temporary minimum that is updated as each successive element
Show that the worst-case complexity in terms of comparisons of an algorithm that finds the maximum and minimum of n elements is at least [3n/2] − 2.
Devise an algorithm that finds all equal pairs of sums of two terms of a sequence of n numbers, and determine the worst-case complexity of your algorithm.
Does 17 divide each of these numbers? a) 68 b) 84 c) 357 d) 1001?
What time does a 12-hour clock read a) 80 hours after it reads 11:00? b) 40 hours before it reads 12:00? c) 100 hours after it reads 6:00?
Suppose that a and b are integers, a ≡ 4 (mod 13), and b ≡ 9 (mod 13). Find the integer c with 0 ≤ c ≤ 12 such that a) C ≡ 9a (mod 13). b) C ≡ 11b (mod 13). c) C ≡ a + b (mod 13). d) C
Let m be a positive integer. Show that a ≡ b (mod m) if a mod m = b mod m?
Let m be a positive integer. Show that a ≡ b (mod m) if a mod m = b mod m?
Find a formula for the integer with smallest absolute value that is congruent to an integer a modulo m, where m is a positive integer?
Evaluate these quantities? a) 13 mod 3 b) −97 mod 11 c) 155 mod 19 d) −221 mod 23
Find a div m and a mod m when? a) a = 228, m = 119. b) a = 9009, m = 223. c) a = −10101, m = 333. d) a = −765432, m = 38271.
Find the integer a such that? a) a ≡ −15 (mod 27) and −26 ≤ a ≤ 0. b) a ≡ 24 (mod 31) and −15 ≤ a ≤ 15. c) a ≡ 99 (mod 41) and 100 ≤ a ≤ 140.
List all integers between−100 and 100 that are congruent to −1 modulo 25?
Decide whether each of these integers is congruent to 5 modulo 17.a) 80b) 103c) −29d) −122?
Find each of these values? a) (−133 mod 23 + 261 mod 23) mod 23 b) (457 mod 23 · 182 mod 23) mod 23
Showing 68700 - 68800
of 88274
First
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
Last