Consider a hash table with 100 slots. Collisions are resolved using ch...
Simple Uniform hashing function is a hypothetical hashing function that evenly distributes items into the slots of a hash table. Moreover, each item to be hashed has an equal probability of being placed into a slot, regardless of the other elements already placed.
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)
View all questions of this test
Consider a hash table with 100 slots. Collisions are resolved using ch...
Given information:
- Hash table with 100 slots
- Collisions resolved using chaining
- Simple uniform hashing
To find: Probability that the first 3 slots are unfilled after the first 3 insertions
Solution:
1. Total number of possible outcomes:
- Each insertion can be made into any of the 100 slots independently.
- Therefore, the total number of possible outcomes for the first insertion is 100.
- Similarly, for the second and third insertions, the number of possible outcomes is also 100 each.
- Since these events are independent, the total number of possible outcomes for all 3 insertions is 100 * 100 * 100 = 100^3.
2. Number of favorable outcomes:
- To have the first 3 slots unfilled, each insertion must land in one of the remaining unfilled slots.
- After the first insertion, there are 100 slots available, so the probability of landing in an unfilled slot is 100/100 = 1.
- After the second insertion, there are 99 slots available (1 slot was filled in the previous step), so the probability of landing in an unfilled slot is 99/99 = 1.
- Similarly, after the third insertion, there are 98 slots available, so the probability of landing in an unfilled slot is 98/98 = 1.
- Therefore, the number of favorable outcomes is 1 * 1 * 1 = 1.
3. Calculating the probability:
- Probability is defined as the ratio of favorable outcomes to total outcomes.
- In this case, the probability is 1/100^3 = 1/100^3 = 1/1000000.
- Simplifying the fraction, we get 1/1000000 = 1/1000 * 1/1000 = 1/1000^2 = 1/1000 * 1/1000.
- Therefore, the probability is (1/1000) * (1/1000) * (1/1000).
Final Answer:
- The probability that the first 3 slots are unfilled after the first 3 insertions is (1/1000) * (1/1000) * (1/1000).
- Simplifying, this can be written as (1/1000)^3 = 1/1000000000 = 1/1003.
- Therefore, the correct answer is option A) (97 97 97)/1003.
Consider a hash table with 100 slots. Collisions are resolved using ch...
B
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).