lab12
.pdf
keyboard_arrow_up
School
University of California, Berkeley *
*We aren’t endorsed by this school
Course
C102
Subject
Computer Science
Date
Apr 29, 2024
Type
Pages
6
Uploaded by GeneralProtonBeaver21
0.0.1
3.b. Comparing the Algorithms
Rank all three algorithms in order of how close the mean estimate was to the true mean. For the algorithm
that had the worst estimate, why do you think it had the worst estimate?
Limit your answer to
1-3
sentences
.
The first algorithm was the closest to the true mean, then algorithm 2 came in second and algorithm 3 had
the worst estimate. This is because Algorithm 3 introduces noise to each row individually, resulting in more
noise overall compared to Algorithm 2, which adds noise to the aggregated data. This increased noise level
can lead to larger errors in the estimate.
1
2
0.0.2
3.c. Practical Considerations
Both Algorithm 2 and Algorithm 3 are
𝜖
-differentially private, but have different performances for mean
estimation. Can you come up with a hypothetical practical scenario where you might want to use Algorithm
3 instead of Algorithm 2?
A scenario where Algorithm 3 might be preferred over Algorithm 2 is in a situation where individual-level
privacy is a higher priority than aggregate-level privacy. This can occur in a medical setting where patients
records are being analyzed for research purposes.
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Algorithm design with sorting. Each of n users spends some time on a social media site. For each i = 1, . . . , n, user i enters the site at time ai and leaves at time bi ≥ ai. You are interested in the question: how many distinct pairs of users are ever on the site at the same time? (Here, the pair (i, j) is the same as the pair (j, i)).Example: Suppose there are 5 users with the following entering and leaving times:
Then, the number of distinct pairs of users who are on the site at the same time is five: these pairs are (1, 2), (1, 3), (2, 3), (4, 6), (5, 6). (Drawing the intervals on a number line may make this easier to see).(a) Given input (a1 , b1),(a2 , b2), . . . ,(an, bn) as above in no particular order (i.e., not sorted in any way), describe a straightforward algorithm that takes Θ(n2)-time to compute the number of pairs of users who are ever on the site at the same time, and explain why it takes Θ(n2)-time. [We are expecting pseudocode and a brief justification for its…
arrow_forward
The maze is described as a graph with a start, goal, edge lengths, and two types of edges: regular paths in the maze, and hedges which one can crawl through. We are only allowed to crawl through edge once. (Some parts of the maze are too thick to crawl through.) Design an algorithm which finds the shortest path to the goal, as quickly as possible.
Please do not use the modified version of Dijkstra. Instead modify the graph and use regular version of Dijkstra
arrow_forward
Perform an experimental analysis on the two algorithms & Visualize their running times as a function of the input size with a log-log chart. 1. prefixAverage12. prefixAverage2
note:
I need with an answer with example to understand it better. Please help me out to complete this question been struggling.
arrow_forward
Suppose that I searched for a number x in a sorted list of n items by comparing against the 5th item, then the 10th, then the 15th, etc. until I found an item bigger than x, and then I searched backwards from that point. Which expression best describes the approximate running time of this algorithm:
arrow_forward
You are given the midsem and endsem marks for the N Students in the course. A student P is said to dominate a student Q, if the midsem and endsem marks of P are both greater than the respective midsem and endsem marks of Q. Design an efficient algorithm for finding all the students that are not dominated by any other student in the class.
arrow_forward
Suppose you have algorithms with five running times. Assume these are the exact running times. How much slower do each of these algorithms get when you (a) double the input or (b) increase the input size by one? Do both.
This problem requires discrete math. I solved all of these but I had a quick question. My teacher wanted us to use the big 0 notation for these running times, but the problem is that I'm not sure if that's necessary for these problems for the question it's asking. I tried to the big 0 notations for the first three. For (a) I got 8n3. Which I'm not sure is right. For example, for 1b I got 3n2 + 3n + 1 for how much slower these get from the original. Is that correct? Was I supposed to do something more for the big 0 notation. You can check to see if these answers are correct.
The big O notation formula is f(n) = 0(g(n)).
(a) n2
For double size I got 4n2. I got 2n + 1 from the input the size by one. I think that's all I need to do. I got similar answers for theother…
arrow_forward
dont dont dont post copied sure sure strict report answer only 100%sure
arrow_forward
In the maze-solving program presented in this chapter, the program un marks each square as it retreats during its backtracking phase. Since this removes the marks from the blind alleys that the program tries along the way, this process ensures that the final path will be displayed correctly.. However, if the goal is to find the finish square in the shortest possible time, it is more efficient to leave these markers in place.
Discuss how this change affects the efficiency of the algorithm. In what situations would this new approach improve the program's performance?
arrow_forward
Prove the correctness of the following pattern-matching algorithm. The input consists of a string S[1..n], and a pattern P[0..m − 1], where 1 ≤ m ≤ n. The algorithmlocates the first contiguous occurrence of the pattern P in the string S, that is, . = p if S[p..p + m − 1] = P, and . = n − m + 1 if the pattern P does not occur at all in the string S. function match(P, S, n, m) comment Find the pattern P[0..m − 1] in string S[1..n] 1. . := 0; matched := false 2. while (. ≤ n − m) ∧ ¬matched do 3. . := . +1; 4. r := 0; matched := true 5. while (r<m) ∧ matched do 6. matched := matched ∧ (P[r] = S[. + r]) 7. r := r + 1 8. return(.)
arrow_forward
Recursive filtering techniques are often used to reduce the computational complexity of
a repeated operation such as filtering. If an image filter is applied to each location in an
image, a (horizontally) recursive formulation of the filtering operation expresses the result
at location (x +1, y) in terms of the previously computed result at location (x, y).
A box convolution filter, B, which has coefficients equal to one inside a rectangular win-
dow, and zero elsewhere is given by:
w-1h-1
B(r, y,w, h) =
ΣΣΤ+ i,y + )
i=0 j=0
where I(r, y) is the pixel intensity of image I at (x, y). We can speed up the computation
of arbitrary sized box filters using recursion as described above. In this problem, you will
derive the procedure to do this.
(a) The function J at location (x,y) is defined to be the sum of the pixel values above
and to the left of (x,y), inclusive:
J(r, y) =
- ΣΣ14.0
i=0 j=0
Formulate a recursion to compute J(r, y). Assume that I(r, y) = 0 if r <0 or y < 0.
Hint: It may be…
arrow_forward
Define "matching in algorithms" using your own words.
arrow_forward
Please only answer part 3
arrow_forward
One-dimensional range searching can be done with O(N log N) steps for preprocessing and O(R+log N) for range searching, where R is the number of points actually falling in the range.
arrow_forward
Implement Queens algorithm: pre-cond: C = 1, c1, 2, c2, ... , r, cr places the jth queen in the jth row and the cjth column. The remaining rows have no queen.post-cond: Returned if possible is a placement optSol of the n queens consistent with this initial placement of the first r queens. A placement is legal if no two queens can capture each other. Whether this is possible is flagged with optCost equal to one or zero.
arrow_forward
You will analyze three algorithms to solve the maximum contiguous subsequence sum problem, and then evaluate the performance of instructor-supplied implementations of those three algorithms. You will compare your theoretical results to your actual results in a written report.
What is the maximum contiguous subsequence sum problem?
Given a sequence of integers A1, A2, ..., An (where the integers may be positive or negative), find a subsequence Aj, ... , Ak that has the maximum value of all possible subsequences.
The maximum contiguous subsequence sum is defined to be zero if all of the integers in the sequence are negative.
Consider the sequence shown below.
A1: -2 A2: 11 A3: -4 A4: 13 A5: -5 A6: 2
The maximum contiguous subsequence sum is 20, representing the contiguous subsequence in positions 2, 3, and 4 (i.e. 11 + (-4) + 13 = 20). The sum of the values in all other contiguous subsequences is less than or equal to 20.
Consider a second sequence, shown below.
A1: 1…
arrow_forward
Create a simple matching algorithm for a round robin competition.
in which the number of participants is n (1 n) and the round index is r (0 r 2 (n 1)/2.out: When i = 0,..., n/2 1, a sequence R of n player indices signaling the match pairings between players R2i and R2i+1; if n is odd, Rn1 denoting the resting player
arrow_forward
In hill-climbing algorithms there are steps that make lots of progress and steps that make very little progress. For example, the first iteration on the input given might find a path through the augmentation graph through which a flow of 30 can be added. It might, however, find the path through which only a flow of 2 can be added. How bad might the running time be when the computation is unlucky enough to always take the worst legal step allowed by the algorithm? Start by taking the step that increases the flow by 2 for the input. Then continue to take the worst possible step. You could draw out each and every step, but it is better to use this opportunity to use loop invariants. What does the flow look like after i iterations? Repeat this process on the same graph except that the four edges forming the square now have capacities 1,000,000,000,000,000 and the crossover edge has capacity 1. (Also move t to c or give that last edge a large capacity.)1. What is the worst case number of…
arrow_forward
Subject: Design & Analysis of algorithms
Questions:
Write your theoretical analysis for the brute force case
Write your theoretical analysis for the divide-and-conquer case
Note: The algorithms of both techniques are both answered before but I need to know their theoretical analysis.
arrow_forward
It is stated in the paper that the algorithm can learn "tabula rasa". If this is the case, then how does it learn?
Select one:
a.
The algorithm observes human players and learns from their expert skills.
b.
The algorithm uses a high-performance alpha-beta search that expands a vast search tree by using a large number of clever heuristics and domain-specific adaptations.
c.
The algorithm learns through playing against itself using a combination of deep neural networks, a reinforcement learning algorithm, and a tree search algorithm.
arrow_forward
Trace the Winnow algorithm with ẞ = 1 for the following input.
Suppose the domain is vectors of length n = 6 over {v1, v2, v3, v4, v5, v6} and the true labels are with respect to the following decision list:
02
06
pöpö
1
01 1
Let the weight at time t be w₁ = (1, 2, 1, 4, 2, 1), and the example be x₁ = (1, 1, 1, 0, 0, 0).
What is the updated weight W++1 at the end of round t?
a.
None of the other answers are correct.
O b. (2, 4, 2, 4, 2, 1)
c. (1, 2, 1, 4, 2, 1)
d. (1/2, 1, 1/2, 4, 2, 1)
e. (1/2, 2, 1/2, 4, 1, 1/2)
f. (2, 2, 2, 4, 4, 2)
arrow_forward
Update all JAVA methods of Cohen Sutherland line clipping algorithm if region code (LRBA). (Where L=left, R=right, B=bottom, A=Above; for example: Left point = (1000), Left-above point = (1001))
arrow_forward
Alert dont submit AI generated answer.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Related Questions
- Algorithm design with sorting. Each of n users spends some time on a social media site. For each i = 1, . . . , n, user i enters the site at time ai and leaves at time bi ≥ ai. You are interested in the question: how many distinct pairs of users are ever on the site at the same time? (Here, the pair (i, j) is the same as the pair (j, i)).Example: Suppose there are 5 users with the following entering and leaving times: Then, the number of distinct pairs of users who are on the site at the same time is five: these pairs are (1, 2), (1, 3), (2, 3), (4, 6), (5, 6). (Drawing the intervals on a number line may make this easier to see).(a) Given input (a1 , b1),(a2 , b2), . . . ,(an, bn) as above in no particular order (i.e., not sorted in any way), describe a straightforward algorithm that takes Θ(n2)-time to compute the number of pairs of users who are ever on the site at the same time, and explain why it takes Θ(n2)-time. [We are expecting pseudocode and a brief justification for its…arrow_forwardThe maze is described as a graph with a start, goal, edge lengths, and two types of edges: regular paths in the maze, and hedges which one can crawl through. We are only allowed to crawl through edge once. (Some parts of the maze are too thick to crawl through.) Design an algorithm which finds the shortest path to the goal, as quickly as possible. Please do not use the modified version of Dijkstra. Instead modify the graph and use regular version of Dijkstraarrow_forwardPerform an experimental analysis on the two algorithms & Visualize their running times as a function of the input size with a log-log chart. 1. prefixAverage12. prefixAverage2 note: I need with an answer with example to understand it better. Please help me out to complete this question been struggling.arrow_forward
- Suppose that I searched for a number x in a sorted list of n items by comparing against the 5th item, then the 10th, then the 15th, etc. until I found an item bigger than x, and then I searched backwards from that point. Which expression best describes the approximate running time of this algorithm:arrow_forwardYou are given the midsem and endsem marks for the N Students in the course. A student P is said to dominate a student Q, if the midsem and endsem marks of P are both greater than the respective midsem and endsem marks of Q. Design an efficient algorithm for finding all the students that are not dominated by any other student in the class.arrow_forwardSuppose you have algorithms with five running times. Assume these are the exact running times. How much slower do each of these algorithms get when you (a) double the input or (b) increase the input size by one? Do both. This problem requires discrete math. I solved all of these but I had a quick question. My teacher wanted us to use the big 0 notation for these running times, but the problem is that I'm not sure if that's necessary for these problems for the question it's asking. I tried to the big 0 notations for the first three. For (a) I got 8n3. Which I'm not sure is right. For example, for 1b I got 3n2 + 3n + 1 for how much slower these get from the original. Is that correct? Was I supposed to do something more for the big 0 notation. You can check to see if these answers are correct. The big O notation formula is f(n) = 0(g(n)). (a) n2 For double size I got 4n2. I got 2n + 1 from the input the size by one. I think that's all I need to do. I got similar answers for theother…arrow_forward
- dont dont dont post copied sure sure strict report answer only 100%surearrow_forwardIn the maze-solving program presented in this chapter, the program un marks each square as it retreats during its backtracking phase. Since this removes the marks from the blind alleys that the program tries along the way, this process ensures that the final path will be displayed correctly.. However, if the goal is to find the finish square in the shortest possible time, it is more efficient to leave these markers in place. Discuss how this change affects the efficiency of the algorithm. In what situations would this new approach improve the program's performance?arrow_forwardProve the correctness of the following pattern-matching algorithm. The input consists of a string S[1..n], and a pattern P[0..m − 1], where 1 ≤ m ≤ n. The algorithmlocates the first contiguous occurrence of the pattern P in the string S, that is, . = p if S[p..p + m − 1] = P, and . = n − m + 1 if the pattern P does not occur at all in the string S. function match(P, S, n, m) comment Find the pattern P[0..m − 1] in string S[1..n] 1. . := 0; matched := false 2. while (. ≤ n − m) ∧ ¬matched do 3. . := . +1; 4. r := 0; matched := true 5. while (r<m) ∧ matched do 6. matched := matched ∧ (P[r] = S[. + r]) 7. r := r + 1 8. return(.)arrow_forward
- Recursive filtering techniques are often used to reduce the computational complexity of a repeated operation such as filtering. If an image filter is applied to each location in an image, a (horizontally) recursive formulation of the filtering operation expresses the result at location (x +1, y) in terms of the previously computed result at location (x, y). A box convolution filter, B, which has coefficients equal to one inside a rectangular win- dow, and zero elsewhere is given by: w-1h-1 B(r, y,w, h) = ΣΣΤ+ i,y + ) i=0 j=0 where I(r, y) is the pixel intensity of image I at (x, y). We can speed up the computation of arbitrary sized box filters using recursion as described above. In this problem, you will derive the procedure to do this. (a) The function J at location (x,y) is defined to be the sum of the pixel values above and to the left of (x,y), inclusive: J(r, y) = - ΣΣ14.0 i=0 j=0 Formulate a recursion to compute J(r, y). Assume that I(r, y) = 0 if r <0 or y < 0. Hint: It may be…arrow_forwardDefine "matching in algorithms" using your own words.arrow_forwardPlease only answer part 3arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education