The following paper does a variety of interesting probabilistic analyses: P. Flajolet et.al., “Birthday paradox, coupon collectors, caching algorithms and self-organizing search”, Discrete Applied Mathematics 39 (1992), 207-229. ( http://algo.inria.fr/flajolet/Publications/FlGaTh92 ) It includes the following formula, which provides the expected number of coupons needed under a general discrete probability distribution P for m coupons: (14b) where For m=3 and , the paper simplifies (14b) to: . Your task is write a C program to 1) evaluate (14b) for the special case that k of the probabilities are the value p and the other m – k probabilities are the value q and 2) implement a simple random simulation of generating coupons for this situation. Your program must compile and execute on omega.uta.edu. (Formula (1) in https://web.cs.wpi.edu/~hofri/CCP says essentially the same thing as the formula above.)
CSE 5311-001 Lab Assignment 1
Due March 3, 2021
Goals:
1. Understanding of coupon collecting
.
2. Understanding of enumeration.
3. Understanding of random simulation to verify a probability result.
Requirements:
1. The following paper does a variety of interesting probabilistic analyses:
P. Flajolet et.al., “Birthday paradox, coupon collectors, caching algorithms and self-organizing search”, Discrete Applied
Mathematics 39 (1992), 207-229. ( http://algo.inria.fr/flajolet/Publications/FlGaTh92 )
It includes the following formula, which provides the expected number of coupons needed under a general discrete
probability distribution P for m coupons:
(14b) where
For m=3 and , the paper simplifies (14b) to:
.
Your task is write a C program to 1) evaluate (14b) for the special case that k of the probabilities are the value p and the
other m – k probabilities are the value q and 2) implement a simple random simulation of generating coupons for this
situation. Your program must compile and execute on omega.uta.edu.
(Formula (1) in https://web.cs.wpi.edu/~hofri/CCP says essentially the same thing as the formula above.)
2. Submit your C code on Canvas before 3:45 p.m. on March 3. Be sure to include comments regarding how to compile and
execute your code.
Getting Started:
1. m will not exceed 50. m is at least 2.
2. The input is very simple:
a. The first input line is m and k. k must be larger than 0 and smaller than m.
b. The second line will have the value of the probability p for each of the first k coupons. p must be larger than 0 and
such that k • p is smaller than 1. Each of the other m – k coupons will have a probability of q = (1 – k • p)/(m – k)
c. The third input line will be the number of times to execute a random simulation.
d. The fourth input line is a seed for the random number generator (e.g. srandom()). (The only significance of the
seed is in the reproducibility of the experiments.)
3. Your powerset approach should use Q(m2) time instead of the Q(2m) time needed by the original version of expression
(14b). Elementary combinatorics ( https://en.wikipedia.org/wiki/Pascal%27s_triangle ) will be
useful. You should output how many times innermost loop(s) execute for the theoretical part. The time for computing
binomial coefficients should not be included.
€
m−1−q
−1( )
q=0
m−1
∑
1
1− PJJ =q
∑
€
PJ = Pi
i∈J
∑
€
p1,p2,p3( ) = a,b,c( )
€
1−
1
1− a
−
1
1−b
−
1
1−c
+
1
1− a−b
+
1
1−b−c
+
1
1−c − a
We provide professional writing services to help you score straight A’s by submitting custom written assignments that mirror your guidelines.
Get result-oriented writing and never worry about grades anymore. We follow the highest quality standards to make sure that you get perfect assignments.
Our writers have experience in dealing with papers of every educational level. You can surely rely on the expertise of our qualified professionals.
Your deadline is our threshold for success and we take it very seriously. We make sure you receive your papers before your predefined time.
Someone from our customer support team is always here to respond to your questions. So, hit us up if you have got any ambiguity or concern.
Sit back and relax while we help you out with writing your papers. We have an ultimate policy for keeping your personal and order-related details a secret.
We assure you that your document will be thoroughly checked for plagiarism and grammatical errors as we use highly authentic and licit sources.
Still reluctant about placing an order? Our 100% Moneyback Guarantee backs you up on rare occasions where you aren’t satisfied with the writing.
You don’t have to wait for an update for hours; you can track the progress of your order any time you want. We share the status after each step.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
Although you can leverage our expertise for any writing task, we have a knack for creating flawless papers for the following document types.
From brainstorming your paper's outline to perfecting its grammar, we perform every step carefully to make your paper worthy of A grade.
Hire your preferred writer anytime. Simply specify if you want your preferred expert to write your paper and we’ll make that happen.
Get an elaborate and authentic grammar check report with your work to have the grammar goodness sealed in your document.
You can purchase this feature if you want our writers to sum up your paper in the form of a concise and well-articulated summary.
You don’t have to worry about plagiarism anymore. Get a plagiarism report to certify the uniqueness of your work.
Join us for the best experience while seeking writing assistance in your college life. A good grade is all you need to boost up your academic excellence and we are all about it.
We create perfect papers according to the guidelines.
We seamlessly edit out errors from your papers.
We thoroughly read your final draft to identify errors.
Work with ultimate peace of mind because we ensure that your academic work is our responsibility and your grades are a top concern for us!
Dedication. Quality. Commitment. Punctuality
Here is what we have achieved so far. These numbers are evidence that we go the extra mile to make your college journey successful.
We have the most intuitive and minimalistic process so that you can easily place an order. Just follow a few steps to unlock success.
We understand your guidelines first before delivering any writing service. You can discuss your writing needs and we will have them evaluated by our dedicated team.
We write your papers in a standardized way. We complete your work in such a way that it turns out to be a perfect description of your guidelines.
We promise you excellent grades and academic excellence that you always longed for. Our writers stay in touch with you via email.