<p>I suggest to borrow physics intuition that "less random" structures are more symmetric. Symmetry for CNF is any transformation of the variables, that keeps the function invariant. By that criteria, functions of 3 variables such as </p>

<p>$\displaystyle x_{1} \vee x_{2} \vee x_{3} .$ </p>

<p>or, say, </p>

<p>$\displaystyle(x_{1} \vee x_{2} \vee \neg x_{3}) \wedge (x_{1} \vee \neg x_{2} \vee x_{3}) \wedge (\neg x_{1} \vee x_{2} \vee x_{3}) \wedge (\neg x_{1} \vee \neg x_{2} \vee \neg x_{3}).$ </p>

<p>are less random than, say </p>

<p>$\displaystyle(x_{1} \vee x_{2} \vee \neg x_{3}) \wedge (x_{1} \vee \neg x_{2} \vee x_{3}) \wedge (\neg x_{1} \vee \neg x_{2} \vee x_{3}) .$ </p>

<p>In general, defining a concept of "random" on finite structures is challenging. Historically, it was tried on binary sequences, which arguably are the simplest finite structures. For example, intuitively, a sequence 01010101 is "less random" than, say, 01001110. However, it was quickly realized that there is no consistent formal definition of <em>finite</em> random sequence! Therefore, one have to be skeptical of any naive attempts to define a measure of randomness for any finite structure.  </p>

CC BY-SA 2.5
2011-02-02T08:48:28.420Z
I totally agree with the intuition _"structure means presence of symmetries, whereas randomness means absence of symmetries"_. You refer to _syntactic_ symmetries (whereas _semantic_ symmetries are those changing the function but leaving the solution space unaltered). I've been always convinced that symmetries are the key.
Giorgio Camerani
CC BY-SA 2.5
2011-02-02T17:15:20.567Z
@Walter: The idea of symmetries is an attempt to leverage algebra rather than algorithms: algorithmic complexity is a measure that defies consistent definition for finite objects. But then we have to assign complexity measure to each element a group (for example, transformation that negates a single variable is simpler than the one that negates two)-- this feels like just pushing the problem around...
Tegiri Nenashi
CC BY-SA 2.5
2011-02-01T23:31:21.313Z
2011-02-01T23:42:34.990Z
2011-02-01T23:42:34.990Z
Tegiri Nenashi
<p>It's widely known that CNF formulas can be roughly partitioned in 2 broad classes: random vs. structured. Structured CNF formulas, in opposition to random CNF formulas, exhibit some sort of order, showing patterns that are unlikely to happen by chance. However, one may find structured formulas showing some degree of randomness (i.e. certain specific groups of clauses seems much less structured than others), as well as random formulas with some weak form of structure (i.e. certain specific groups of clauses seems less randomic than others). Hence it seems that the randomness of a formula is not just a yes/no fact.</p>

<p>Let $r: \mathcal{F} \rightarrow [0,1]$ be a function that, given a CNF formula $F \in \mathcal{F}$, returns a real value between $0$ and $1$ inclusive: $0$ means a pure structured formula, while $1$ means a pure random formula.</p>

<p>I wonder if someone has ever tried to invent such a $r$. Of course the value returned by $r$ would be (at least this is my intent) just a practical measurement according to some reasonable criteria, rather than a solid theoretical truth.</p>

<p>I'm also interested to know if someone has ever defined and studied any statistical indicator that can be used in the definition of $r$, or in determining other useful overall properties of a formula. By statistical indicator I mean something like that:</p>

<ol>
<li><b>HCV (Hit Count Variance)</b><br><br>Let $h_F: \mathbb{N} \rightarrow \mathbb{N}$ be a function that, given a variable $v_j \in \mathbb{N}$, returns the number of times $v_j$ appears in $F$. Let $V$ be the set of variables used in $F$. Let $\bar{h}_F = \frac{1}{|V|} \sum_{v_j \in V}{h_F(v_j)}$ be the AHC (Average Hit Count). The HCV is defined as follows:
<br><br>
$HVC = \frac{1}{|V|} \sum_{v_j \in V}{(h_F(v_j) - \bar{h}_F)^2}$
<br><br>
In random instances, the HCV is very low (all variables are mentioned almost the same number of times), while in structured instances it is not (some variables are used very frequently and some others are not, i.e. there are "clusters of usage").<br><br>
<li><b>AID (Average Impurity Degree)</b><br><br>Let $h_F^{+}(v_j)$ be the number of times $v_j$ occurs positive, and let $h_F^{-}(v_j)$ the number of times it occurs negative. Let $i: \mathbb{N} \rightarrow [0,1]$ be a function that, given a variable $v_j \in V$, returns its ID (Impurity Degree). The function $i(v_j)$ is defined as follows: $i(v_j) = 2 \cdot \frac{min(h_F^{+}(v_j), h_F^{-}(v_j))}{h_F(v_j)}$. Those variables occurring half of the times positive and half of the times negative have maximum Impurity Degree, while those variables occurring always positive or always negative (i.e. pure literals) have minimum Impurity Degree. The AID is simply defined as follows:
<br><br>
$AID = \frac{1}{|V|} \sum_{v_j \in V}{i(v_j)}$<br>
<br>
In random instances (at least in those generated by negating variables with probability $0.5$), the AID is almost equal to $1$, while in structured instances it is usually far from $1$.<br><br>
<li><b>IDV (Impurity Degree Variance)</b><br><br>The IDV is a more robust indicator than the AID alone, since it accounts for random instances generated by negating variables with probability different than $0.5$. It is defined as:
<br><br>
$IDV = \frac{1}{|V|} \sum_{v_j \in V}{(i(v_j) - AID)^2}$<br><br>
In random instances the IDV is $0$ (because every variable is negated with the same probability), while in structured instances it is far from $0$.
</ol>

<blockquote>
  <p><b>Motivations</b></p>
  
  <ol>
  <li>To better understand how CNF formulas work, how their randomness/structure could be measured, if other useful overall properties could be inferred by looking at their statistical indicators, if and how such indicators could be used to speed up search. 
  <li>Wonder if the satisfiability (or even the number of solutions) of a CNF formula could be inferred by just cleverly manipulating its statistical indicators.
  </ol>
  
  <p><b>Questions</b></p>
  
  <ol>
  <li>Did anyone ever proposed a way to measure the randomness of a CNF formula?
  <li>Did anyone ever proposed any statistical indicator that can be used to study or even to mechanically infer useful overall properties of a CNF formula?  
  </ol>
</blockquote>

CC BY-SA 2.5
2011-02-01T00:54:54.240Z
see the paper in this answer (http://cstheory.stackexchange.com/questions/4321/making-sat-solvers-competitive-with-specialized-algorithms/4325#4325). It could give you a tip on how to define such r
Marcos Villagra
CC BY-SA 2.5
2011-02-01T03:25:50.707Z
possibly relevant discussion on measuring randomness of bit-strings http://mathoverflow.net/questions/37518/why-do-statistical-randomness-tests-seem-so-ad-hoc/37523#37523
Yaroslav Bulatov
CC BY-SA 2.5
2011-02-01T22:35:55.643Z
I can tell you this much since I have been working on this by myself for a while. If you consider SAT, the formulas for 1 & 2 are exponential. On the other hand for k-SAT the formulas for 1 & 2 are polynomial. This relates to my PRECISE DEFINITION OF RANDOM K-SAT QUESTION, which no one seems to want to answer.
Tayfun Pay
CC BY-SA 2.5
2011-02-02T04:37:44.900Z
@Geekster: Would you like to provide an answer here?
Hsien-Chih Chang 張顯之
CC BY-SA 2.5
2011-02-02T08:34:16.040Z
@Geekster: What do you mean with _"...the formulas for 1 & 2 are exponential"_?
Giorgio Camerani
CC BY-SA 2.5
2011-02-03T01:43:06.763Z
Would that be something like a normalized Kolmogorov complexity, i.e. r(F):=C(F)/|F|, or some resource-bounded variant of it?
Marcus Ritt
<cc.complexity-theory><sat><randomness><symmetry>
Measuring the randomness of CNF formulas
Giorgio Camerani
# Measuring the randomness of CNF formulas

(Asked by: username_0 on 2011-01-31)

It's widely known that CNF formulas can be roughly partitioned in 2 broad classes: random vs. structured. Structured CNF formulas, in opposition to random CNF formulas, exhibit some sort of order, showing patterns that are unlikely to happen by chance. However, one may find structured formulas showing some degree of randomness (i.e. certain specific groups of clauses seems much less structured than others), as well as random formulas with some weak form of structure (i.e. certain specific groups of clauses seems less randomic than others). Hence it seems that the randomness of a formula is not just a yes/no fact.

Let $r: \mathcal{F} \rightarrow [0,1]$ be a function that, given a CNF formula $F \in \mathcal{F}$, returns a real value between $0$ and $1$ inclusive: $0$ means a pure structured formula, while $1$ means a pure random formula.

I wonder if someone has ever tried to invent such a $r$. Of course the value returned by $r$ would be (at least this is my intent) just a practical measurement according to some reasonable criteria, rather than a solid theoretical truth.

I'm also interested to know if someone has ever defined and studied any statistical indicator that can be used in the definition of $r$, or in determining other useful overall properties of a formula. By statistical indicator I mean something like that:

1. **HCV (Hit Count Variance)**  
     
   Let $h\_F: \mathbb{N} \rightarrow \mathbb{N}$ be a function that, given a variable $v\_j \in \mathbb{N}$, returns the number of times $v\_j$ appears in $F$. Let $V$ be the set of variables used in $F$. Let $\bar{h}\_F = \frac{1}{|V|} \sum\_{v\_j \in V}{h\_F(v\_j)}$ be the AHC (Average Hit Count). The HCV is defined as follows:
     
     
   $HVC = \frac{1}{|V|} \sum\_{v\_j \in V}{(h\_F(v\_j) - \bar{h}\_F)^2}$
     
     
   In random instances, the HCV is very low (all variables are mentioned almost the same number of times), while in structured instances it is not (some variables are used very frequently and some others are not, i.e. there are "clusters of usage").  
     
   - **AID (Average Impurity Degree)**  
       
     Let $h\_F^{+}(v\_j)$ be the number of times $v\_j$ occurs positive, and let $h\_F^{-}(v\_j)$ the number of times it occurs negative. Let $i: \mathbb{N} \rightarrow [0,1]$ be a function that, given a variable $v\_j \in V$, returns its ID (Impurity Degree). The function $i(v\_j)$ is defined as follows: $i(v\_j) = 2 \cdot \frac{min(h\_F^{+}(v\_j), h\_F^{-}(v\_j))}{h\_F(v\_j)}$. Those variables occurring half of the times positive and half of the times negative have maximum Impurity Degree, while those variables occurring always positive or always negative (i.e. pure literals) have minimum Impurity Degree. The AID is simply defined as follows:
       
       
     $AID = \frac{1}{|V|} \sum\_{v\_j \in V}{i(v\_j)}$  
       
     In random instances (at least in those generated by negating variables with probability $0.5$), the AID is almost equal to $1$, while in structured instances it is usually far from $1$.  
       
     - **IDV (Impurity Degree Variance)**  
         
       The IDV is a more robust indicator than the AID alone, since it accounts for random instances generated by negating variables with probability different than $0.5$. It is defined as:
         
         
       $IDV = \frac{1}{|V|} \sum\_{v\_j \in V}{(i(v\_j) - AID)^2}$  
         
       In random instances the IDV is $0$ (because every variable is negated with the same probability), while in structured instances it is far from $0$.

> **Motivations**
>
> 1. To better understand how CNF formulas work, how their randomness/structure could be measured, if other useful overall properties could be inferred by looking at their statistical indicators, if and how such indicators could be used to speed up search.- Wonder if the satisfiability (or even the number of solutions) of a CNF formula could be inferred by just cleverly manipulating its statistical indicators.
>
> **Questions**
>
> 1. Did anyone ever proposed a way to measure the randomness of a CNF formula?- Did anyone ever proposed any statistical indicator that can be used to study or even to mechanically infer useful overall properties of a CNF formula?

**Tags:** cc.complexity-theory, sat, randomness, symmetry
> **Comments:**
> **username_1**: see the paper in this answer (http://cstheory.stackexchange.com/questions/4321/making-sat-solvers-competitive-with-specialized-algorithms/4325#4325). It could give you a tip on how to define such r  
> **username_2**: possibly relevant discussion on measuring randomness of bit-strings http://mathoverflow.net/questions/37518/why-do-statistical-randomness-tests-seem-so-ad-hoc/37523#37523  
> **username_3**: I can tell you this much since I have been working on this by myself for a while. If you consider SAT, the formulas for 1 & 2 are exponential. On the other hand for k-SAT the formulas for 1 & 2 are polynomial. This relates to my PRECISE DEFINITION OF RANDOM K-SAT QUESTION, which no one seems to want to answer.  
> **username_4**: @Geekster: Would you like to provide an answer here?  
> **username_0**: @Geekster: What do you mean with _"...the formulas for 1 & 2 are exponential"_?  
> **username_5**: Would that be something like a normalized Kolmogorov complexity, i.e. r(F):=C(F)/|F|, or some resource-bounded variant of it?  

---

## 1 answers

### Answer by username_6 on 2011-02-01. Score: 3

I suggest to borrow physics intuition that "less random" structures are more symmetric. Symmetry for CNF is any transformation of the variables, that keeps the function invariant. By that criteria, functions of 3 variables such as

$\displaystyle x\_{1} \vee x\_{2} \vee x\_{3} .$

or, say,

$\displaystyle(x\_{1} \vee x\_{2} \vee \neg x\_{3}) \wedge (x\_{1} \vee \neg x\_{2} \vee x\_{3}) \wedge (\neg x\_{1} \vee x\_{2} \vee x\_{3}) \wedge (\neg x\_{1} \vee \neg x\_{2} \vee \neg x\_{3}).$

are less random than, say

$\displaystyle(x\_{1} \vee x\_{2} \vee \neg x\_{3}) \wedge (x\_{1} \vee \neg x\_{2} \vee x\_{3}) \wedge (\neg x\_{1} \vee \neg x\_{2} \vee x\_{3}) .$

In general, defining a concept of "random" on finite structures is challenging. Historically, it was tried on binary sequences, which arguably are the simplest finite structures. For example, intuitively, a sequence 01010101 is "less random" than, say, 01001110. However, it was quickly realized that there is no consistent formal definition of *finite* random sequence! Therefore, one have to be skeptical of any naive attempts to define a measure of randomness for any finite structure.

> **Comments:**
> **username_0**: I totally agree with the intuition _"structure means presence of symmetries, whereas randomness means absence of symmetries"_. You refer to _syntactic_ symmetries (whereas _semantic_ symmetries are those changing the function but leaving the solution space unaltered). I've been always convinced that symmetries are the key.  
> **username_6**: @Walter: The idea of symmetries is an attempt to leverage algebra rather than algorithms: algorithmic complexity is a measure that defies consistent definition for finite objects. But then we have to assign complexity measure to each element a group (for example, transformation that negates a single variable is simpler than the one that negates two)-- this feels like just pushing the problem around...  

---

