通过查询估计集合基数

问题描述 投票:0回答:0

我有以下作业问题,我想知道您是否可以提供一些提示。


你的朋友心中有一组数字 S ⊆ {1, ... , n}。如果你问他关于集合 Q ⊆ {1, ..., n} 他会回答交集 S ∩ Q 是否为空。您的目标是估计(大约)集合 S 中包含多少元素。

设计一个策略来区分对于任何 k ∈ {1, . . ,n}。表明 O (log(1/δ)/ε^2) 查询足以区分概率为 1 - δ 的 2 个案例。


我认为通过选择一个包含每个元素 i ∈ {1, ..., n} 且概率为 1/k 的随机集合 Q,那么如果 S 至少有 k 个元素,那么 S 和 Q 中元素的预期数量将为 |S|/k。然后,如果交集是空的,我们可以说(也许很有可能,我不确定)|S| < k. I think that I should run this experiment t times and have t random variables Xi, where Xi = 1 if the intersection is not empty, 0 otherwise. If the sum of Xi is at least t/2 then we could say that with some probability |S| < k. I am not sure if this is correct and which is the best approach to compute the probability. Moreover, I am not sure how to distinguish whether S contains ≤ k or ≥ (1 + ε)k elements.

你认为我应该如何进行?

algorithm math probability inequality
© www.soinside.com 2019 - 2024. All rights reserved.