Small space hash functions that are weakly but not strongly universal

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












3












$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?










share|cite|improve this question









$endgroup$
















    3












    $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?










    share|cite|improve this question









    $endgroup$














      3












      3








      3





      $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?










      share|cite|improve this question









      $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






      share|cite|improve this question













      share|cite|improve this question











      share|cite|improve this question




      share|cite|improve this question










      asked Feb 16 at 16:19









      AnushAnush

      1407




      1407




















          1 Answer
          1






          active

          oldest

          votes


















          3












          $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.






          share|cite|improve this answer









          $endgroup$












            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
            );



            );













            draft saved

            draft discarded


















            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









            3












            $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.






            share|cite|improve this answer









            $endgroup$

















              3












              $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.






              share|cite|improve this answer









              $endgroup$















                3












                3








                3





                $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.






                share|cite|improve this answer









                $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.







                share|cite|improve this answer












                share|cite|improve this answer



                share|cite|improve this answer










                answered Feb 16 at 18:37









                Yuval FilmusYuval Filmus

                194k14183347




                194k14183347



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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






                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?