📜  门| GATE-CS-2014-(Set-3) |第 65 题

📅  最后修改于: 2021-09-27 05:40:04             🧑  作者: Mango

考虑一个有 100 个槽的哈希表。使用链接解决冲突。假设简单的均匀散列,在前 3 次插入后前 3 个槽未被填充的概率是多少?
(A) (97 × 97 × 97)/100 3
(B) (99 × 98 × 97)/100 3
(C) (97 × 96 × 95)/100 3
(D) (97 × 96 × 95)/(3! × 100 3 )答案:(一)
解释:简单统一散列函数是一种假设的散列函数,它将项目均匀地分布到散列表的槽中。此外,每个要散列的项目被放入一个槽的概率是相等的,而不管其他元素是否已经放置。 (来源:https://en.wikipedia.org/wiki/SUHA_%28computer_science%29)。

Probability that the first 3 slots are unfilled after the first 3 insertions = 
                (probability that first item doesn't go in any of the first 3 slots)*
                (probability that second item doesn't go in any of the first 3 slots)*
                (probability that third item doesn't go in any of the first 3 slots)

                 = (97/100) * (97/100) * (97/100) 

这个问题的测验