Question

Given a data stream of unknown length, randomly pick k elements from the stream so that...

Given a data stream of unknown length, randomly pick k elements from the stream so that each element has the same probability of being chosen. Describe two different approaches that would work for this.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Ans: Two Different approaches. 0 Reservoir Sampling: o Sample the first k elements from - the stream, (1) Sample the ethe ele

Add a comment
Know the answer?
Add Answer to:
Given a data stream of unknown length, randomly pick k elements from the stream so that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Assume that source elements of length k are mapped in some uniform fashion into a target...

    Assume that source elements of length k are mapped in some uniform fashion into a target elements of length p. If each digit can take on one ofr values, then the number of source elements is rk and the number of target elements is the smaller number rp. A particular sourceelement xi is mapped to a particular target element yj.a. What is the probability that the correct source element can be selected by an adversary on one try?b. What is...

  • Eight rooks are placed randomly on a chess board. What is the probability that none of the rooks can capture any of the other rooks? Translation for those who are not familiar with chess: pick 8 unit...

    Eight rooks are placed randomly on a chess board. What is the probability that none of the rooks can capture any of the other rooks? Translation for those who are not familiar with chess: pick 8 unit squares at random from an 8 × 8 square grid. What is the probability that no two chosen squares share a row or a column? Hint. You can think of placing the rooks both with or without order, both approaches work.

  • Given that the data below was randomly selected from a lognormal distribution. What is the probability...

    Given that the data below was randomly selected from a lognormal distribution. What is the probability of the average of 39 randomly selected items being greater than 22.1? The data below is the complete SAMPLED data set. WE TOOK A SAMPLE FROM THE TOTAL POPULATION. YOU DO NOT GET ANY MORE DATA POINTS. IF YOU DON'T KNOW HOW TO SOLVE THIS, MOVE ON. The question screen shot and answer is below. (Answer is 0.9755422) Please show how to arrive at...

  • Given that the data below was randomly selected from a lognormal distribution. What is the probability...

    Given that the data below was randomly selected from a lognormal distribution. What is the probability of the average of 39 randomly selected items being less than 3.9? Give your answer to 3 decimal places. Data 8.4, 2.49, 4.84, 6.08, 1.09, 1.05, 8.64, 2.92

  • 2. (15 marks) Consider the abstract datatype SEQ whose objects are sequences of elements and whic...

    do (b) please 2. (15 marks) Consider the abstract datatype SEQ whose objects are sequences of elements and which supports two operations . PREPEND(x, S), which inserts element r at the beginning of the sequence S and . ACCESS(S, i), which returns the ith element in the sequence Suppose that we represent S by a singly linked list. Then PREPEND(, S) takes 1 step and ACCESS(S, i) takes i steps, provided S has at least i elements Suppose that S...

  • 1) Three students are randomly chosen from a school with 800 students (200 students each in...

    1) Three students are randomly chosen from a school with 800 students (200 students each in grades 9, 10, 11, and 12). Find the probability of each event. a. All were in different grades. b. At least two people were in the same grade.

  • program in python Randomness can be used to improve the performance of deterministic algorithms which need...

    program in python Randomness can be used to improve the performance of deterministic algorithms which need to make many choices. Rather than repeatedly making fixed, hard-coded choices, a pseudorandom number generator can be used to make dynamic, unbiased choices. If the benefits of "good" choices outweigh the costs of "bad" choices, a random selection of good and bad choices can improve the performance of an algorithm Let us explore this with the QUICKSELECT algorithm. Discovered by the influential computer science...

  • Write short programs to simulate problem 16 and 22. For problem 22, use k=5, m=10, n=5....

    Write short programs to simulate problem 16 and 22. For problem 22, use k=5, m=10, n=5. In Python Problem 16 We are given three coins: one has heads in both faces, the second has tails in both faces, and the third has a head in one face and a tail in the other. We choose a coin at random, toss it, and the result is heads. What is the probability that the opposite face is tails? Problem 22 Each of...

  • 1.5. Review Exercises 1. If we randomly pick two television sets in succession from a shipment...

    1.5. Review Exercises 1. If we randomly pick two television sets in succession from a shipment of 240 television sets of which 15 are defective, what is the probability that they will both be defective? 2. A poll of 500 people determines that 382 like ice cream and 362 like cake. How many people like both if each of them likes at least one of the two? (Hint: Use P(AU B)-P(A) + P(B)-P(A n B) ). 3. The Mathematics Department...

  • 1. A password of length 5 is generated at random as a sequence of letters from...

    1. A password of length 5 is generated at random as a sequence of letters from A,...,Z with repetitions allowed. What is the probability that in every pair of adjacent positions in the password, the letters are different (for example, XJXTQ but not XXJTQ) ? 2. Bowl #1 contains 2 red chips and 3 white chips. Bowl #2 contains 3 red chips and 4 white chips. One of the bowls is chosen at random, and a chip is withdrawn from...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT