Small space hash functions that are weakly but not strongly universal
Clash Royale CLAN TAG#URR8PPP
$begingroup$
This is a follow up to this this question about weakly universal hash functions
A family of hash functions $H_w$ is said to be weakly universal if for all $x ne y$ :
$$P_h in H_w(h(x) = h(y)) leq 1/m$$
Here the function $h:U rightarrow [m]$ is chosen uniformly from the family $H$ and we assume $|U| > m$.
A family of hash functions $H_s$ is said to be strongly universal if for all $x ne y$ and $k, ell in [m]$:
$$P_h in H_s(h(x) = k land h(y) = ell) = 1/m^2$$
I previously asked for an example of a hash function family which is weakly universal but not strongly universal. The very nice answer was:
Take $U = [m+1]$, and consider the functions $h_i$, for $i in [m]$,
given by $$ h_i(x) = begincases x & textif x neq m+1, \ i &
> textif x = m+1. endcases $$ The same approach can be used for
arbitrary $|U|$: fix the first $m$ coordinates, and make all other
coordinates uniformly and independently random.
For arbitrary $|U|$, it seems that in order to represent a single hash function in practice you would need to store a lookup table of size $|U|$ to ensure that the hashed values are independent and truly random. Then for every key, you would look up its random value in the vast lookup table to compute the hash function.
Is there a hash function family where the hash functions require constant or log space that achieves the same result of being weakly but not strongly universal? In other words, are there any practical hash function families that are weakly not but strongly universal?
hash hash-tables probabilistic-algorithms hashing
$endgroup$
add a comment |
$begingroup$
This is a follow up to this this question about weakly universal hash functions
A family of hash functions $H_w$ is said to be weakly universal if for all $x ne y$ :
$$P_h in H_w(h(x) = h(y)) leq 1/m$$
Here the function $h:U rightarrow [m]$ is chosen uniformly from the family $H$ and we assume $|U| > m$.
A family of hash functions $H_s$ is said to be strongly universal if for all $x ne y$ and $k, ell in [m]$:
$$P_h in H_s(h(x) = k land h(y) = ell) = 1/m^2$$
I previously asked for an example of a hash function family which is weakly universal but not strongly universal. The very nice answer was:
Take $U = [m+1]$, and consider the functions $h_i$, for $i in [m]$,
given by $$ h_i(x) = begincases x & textif x neq m+1, \ i &
> textif x = m+1. endcases $$ The same approach can be used for
arbitrary $|U|$: fix the first $m$ coordinates, and make all other
coordinates uniformly and independently random.
For arbitrary $|U|$, it seems that in order to represent a single hash function in practice you would need to store a lookup table of size $|U|$ to ensure that the hashed values are independent and truly random. Then for every key, you would look up its random value in the vast lookup table to compute the hash function.
Is there a hash function family where the hash functions require constant or log space that achieves the same result of being weakly but not strongly universal? In other words, are there any practical hash function families that are weakly not but strongly universal?
hash hash-tables probabilistic-algorithms hashing
$endgroup$
add a comment |
$begingroup$
This is a follow up to this this question about weakly universal hash functions
A family of hash functions $H_w$ is said to be weakly universal if for all $x ne y$ :
$$P_h in H_w(h(x) = h(y)) leq 1/m$$
Here the function $h:U rightarrow [m]$ is chosen uniformly from the family $H$ and we assume $|U| > m$.
A family of hash functions $H_s$ is said to be strongly universal if for all $x ne y$ and $k, ell in [m]$:
$$P_h in H_s(h(x) = k land h(y) = ell) = 1/m^2$$
I previously asked for an example of a hash function family which is weakly universal but not strongly universal. The very nice answer was:
Take $U = [m+1]$, and consider the functions $h_i$, for $i in [m]$,
given by $$ h_i(x) = begincases x & textif x neq m+1, \ i &
> textif x = m+1. endcases $$ The same approach can be used for
arbitrary $|U|$: fix the first $m$ coordinates, and make all other
coordinates uniformly and independently random.
For arbitrary $|U|$, it seems that in order to represent a single hash function in practice you would need to store a lookup table of size $|U|$ to ensure that the hashed values are independent and truly random. Then for every key, you would look up its random value in the vast lookup table to compute the hash function.
Is there a hash function family where the hash functions require constant or log space that achieves the same result of being weakly but not strongly universal? In other words, are there any practical hash function families that are weakly not but strongly universal?
hash hash-tables probabilistic-algorithms hashing
$endgroup$
This is a follow up to this this question about weakly universal hash functions
A family of hash functions $H_w$ is said to be weakly universal if for all $x ne y$ :
$$P_h in H_w(h(x) = h(y)) leq 1/m$$
Here the function $h:U rightarrow [m]$ is chosen uniformly from the family $H$ and we assume $|U| > m$.
A family of hash functions $H_s$ is said to be strongly universal if for all $x ne y$ and $k, ell in [m]$:
$$P_h in H_s(h(x) = k land h(y) = ell) = 1/m^2$$
I previously asked for an example of a hash function family which is weakly universal but not strongly universal. The very nice answer was:
Take $U = [m+1]$, and consider the functions $h_i$, for $i in [m]$,
given by $$ h_i(x) = begincases x & textif x neq m+1, \ i &
> textif x = m+1. endcases $$ The same approach can be used for
arbitrary $|U|$: fix the first $m$ coordinates, and make all other
coordinates uniformly and independently random.
For arbitrary $|U|$, it seems that in order to represent a single hash function in practice you would need to store a lookup table of size $|U|$ to ensure that the hashed values are independent and truly random. Then for every key, you would look up its random value in the vast lookup table to compute the hash function.
Is there a hash function family where the hash functions require constant or log space that achieves the same result of being weakly but not strongly universal? In other words, are there any practical hash function families that are weakly not but strongly universal?
hash hash-tables probabilistic-algorithms hashing
hash hash-tables probabilistic-algorithms hashing
asked Feb 16 at 16:19
AnushAnush
1407
1407
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
Let $H$ be a family of strongly universal hash functions from $U$ to $[m]$.
Construct a new family of hash functions from $U cup x to [m]$ by extending all functions $h in H$ with $h(x) = 1$. The family is weakly universal since $h(u)$ is distributed uniformly for every $u in U$, but it is clearly not strongly universal.
$endgroup$
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f104431%2fsmall-space-hash-functions-that-are-weakly-but-not-strongly-universal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
Let $H$ be a family of strongly universal hash functions from $U$ to $[m]$.
Construct a new family of hash functions from $U cup x to [m]$ by extending all functions $h in H$ with $h(x) = 1$. The family is weakly universal since $h(u)$ is distributed uniformly for every $u in U$, but it is clearly not strongly universal.
$endgroup$
add a comment |
$begingroup$
Let $H$ be a family of strongly universal hash functions from $U$ to $[m]$.
Construct a new family of hash functions from $U cup x to [m]$ by extending all functions $h in H$ with $h(x) = 1$. The family is weakly universal since $h(u)$ is distributed uniformly for every $u in U$, but it is clearly not strongly universal.
$endgroup$
add a comment |
$begingroup$
Let $H$ be a family of strongly universal hash functions from $U$ to $[m]$.
Construct a new family of hash functions from $U cup x to [m]$ by extending all functions $h in H$ with $h(x) = 1$. The family is weakly universal since $h(u)$ is distributed uniformly for every $u in U$, but it is clearly not strongly universal.
$endgroup$
Let $H$ be a family of strongly universal hash functions from $U$ to $[m]$.
Construct a new family of hash functions from $U cup x to [m]$ by extending all functions $h in H$ with $h(x) = 1$. The family is weakly universal since $h(u)$ is distributed uniformly for every $u in U$, but it is clearly not strongly universal.
answered Feb 16 at 18:37
Yuval FilmusYuval Filmus
194k14183347
194k14183347
add a comment |
add a comment |
Thanks for contributing an answer to Computer Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f104431%2fsmall-space-hash-functions-that-are-weakly-but-not-strongly-universal%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown