Score:0

Same hash for subsets of a set?

tt flag

Suppose I have a set $S$ containing $n$ bit strings, where $n$ is on the order of about 10. Consider

$$\mathfrak{S} = \{ R : R \subseteq S, |R| \geq 2 \},$$

the collection of subsets of $S$ with two or more elements.

Does there exist a hashing function which outputs the same hash for any member of $\mathfrak{S}$?

A potential relaxation in which we order the elements of the subsets in $\mathfrak{S}$ would be acceptable as well.

kodlu avatar
sa flag
are you interested in a secure hash of some kind? or any hash? Just map all subsets with cardinality more than 1 to 0, map the rest of the sets to 1. Also you haven't even defined the input and output set. as asked this question is absolutely meaningless.
Score:1
my flag

Does there exist a hashing function which outputs the same hash for any member of $\mathfrak{S}$?

One can certainly define such a hash function.

If we assume $\text{SHA}$ is a standard secure hash function, then one simple $H$ that means your requirements is:

$$H(x) = \begin{cases} \text{SHA}(0) & \quad \text{if } x \in \mathfrak{S} \\ \text{SHA}(1 | x) & \quad \text{if } x \not\in \mathfrak{S} \end{cases}$$

$H$ is a secure hash function, except that it hashes two elements of $\mathfrak{S}$ to the same value; that is, if someone finds a collision in $H$ (not involving two elements of $\mathfrak{S}$), one can immediately find a collision in $\text{SHA}$, which we assumed was secure.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.