Suppose $K= \{ k^2:1\leq k\leq 100 \} $ as the set of keys that hashed by two hash functions $$ a)\;\; h(k)=k\mod 12 $$ $$b)\;\; h(k)=k\mod 11 $$ I want to show that $a$ is not a good choice because it hash even numbers to slots with even index. But I try to find out how many elements hashed to each index for $a$ and $b$ to show that $a$ increases our cost for a search operation. I find out in $a$, if $k=12t$ like $12,24,36,\dots$ hashed to index $0$ but is there a simple way to speed up my computations?
2026-03-25 16:01:51.1774454511
Counting number of keys hashed to each slots
65 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in ELEMENTARY-NUMBER-THEORY
- Maximum number of guaranteed coins to get in a "30 coins in 3 boxes" puzzle
- Interesting number theoretical game
- How do I show that if $\boldsymbol{a_1 a_2 a_3\cdots a_n \mid k}$ then each variable divides $\boldsymbol k $?
- Using only the digits 2,3,9, how many six-digit numbers can be formed which are divisible by 6?
- Algebra Proof including relative primes.
- How do I show that any natural number of this expression is a natural linear combination?
- Counting the number of solutions of the congruence $x^k\equiv h$ (mod q)
- algebraic integers of $x^4 -10x^2 +1$
- What exactly is the definition of Carmichael numbers?
- Number of divisors 888,888.
Related Questions in DISCRETE-MATHEMATICS
- What is (mathematically) minimal computer architecture to run any software
- What's $P(A_1\cap A_2\cap A_3\cap A_4) $?
- The function $f(x)=$ ${b^mx^m}\over(1-bx)^{m+1}$ is a generating function of the sequence $\{a_n\}$. Find the coefficient of $x^n$
- Given is $2$ dimensional random variable $(X,Y)$ with table. Determine the correlation between $X$ and $Y$
- Given a function, prove that it's injective
- Surjective function proof
- How to find image of a function
- Find the truth value of... empty set?
- Solving discrete recursion equations with min in the equation
- Determine the marginal distributions of $(T_1, T_2)$
Related Questions in HASH-FUNCTION
- What is the graph of my chances to mine a bitcoin?
- Calculating probability of no hash collision
- Representing a String of n characters, as a unique integer
- Existence of a Perfect Cryptographic Hash Function
- $2$-universal family of hash functions and $\varepsilon$-good
- Hash without overflow
- Days required to collide at least one hash?
- Finding collision probability of hash function using modulo operation
- Given a boolen hash function (based on XOR), find the $n^{th}$ key for a specific hash.
- Given a square grid of side length N and m objects, design a bijection between each object and a unique set of coordinates
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
For b), $h(x)=0$ iff $x$ is a multiple of $11$, so for approximately $\frac1{11}$ of the keys. The rest splits approximately evenly among the five remainders 1, 4, 9, 5, 3 (whereas 2, 6, 7, 8, 10 are never congruent to squares), so $\approx \frac2{11}$ of the keys per class.
For a), we have a bit more work because 12 is not prime. But we can factor it as $4\cdot 3$ and investigate the parts separately (at least approximately) per the Chinese Remainder Theorem. Modulo $4$, a square is either $0$ for even or $1$ for odd numbers. Modulo $3$, a square is either $0$ (for the multiples of $3$) or $1$ (for all others). By combining these results, we see that approximately $\frac12\cdot \frac13=\frac16$ each are $0$ or $9$ modulo $12$, approximately $\frac12\cdot \frac23=\frac13$ each are $1$ or $4$ modulo $12$.
If you are unhappy with the word "approximately" occurring so often, note that the remainder of $x^2\bmod 12$ depends only on $x\bmod 6$, so the mentioned proportions hold exactly for every group of six consecutive keys. So if we had $K=\{\,k^2\mid 5\le k\le 100\,\}$, we'd have exactly 16 times 0, 16 times 9, 32 times 1, and 32 times 4. The additional keys $1$, $4$, $9$, $16$ modify the stats to: 16 times 0, 17 times 9, 33 times 1, and 34 times 4.