DEV Community

Nnamdi Okpala
Nnamdi Okpala

Posted on

The Hamming Distance Causality Model: Measuring Causal Relationships on Bipartite Graphs

By Nnamdi Michael Okpala (OBINexus)

"When systems fail, build your own."

Introduction

Over the past several years, I have been building the theoretical foundations for what I call MMUCO OS, a verification-first operating system designed to reason about information, knowledge, and causality.

One question has continually occupied my thinking:

Can causality itself be measured?

Traditional graph theory tells us whether two nodes are connected. Probability theory estimates the likelihood of an event. Information theory measures uncertainty. Yet none of these, by themselves, provide a mathematical notion of causal distance.

This article introduces my proposed Hamming Distance Causality Model (HDCM), a framework that extends graph traversal with causal semantics by combining bipartite graphs, coloured edges, Hamming distance, and temporal reasoning.

This work is part of the broader OBINexus research programme.


Motivation

The inspiration came from thinking about how complex timelines are reconstructed.

Consider the following sequence:

Phone purchased
        ↓
Application installed
        ↓
Photo captured
        ↓
Photo edited
        ↓
Photo deleted
Enter fullscreen mode Exit fullscreen mode

Although the final photograph no longer exists, the sequence of events still forms a causal chain.

My goal is to represent these causal chains mathematically so they can be measured rather than simply observed.

Instead of asking

"Is there a connection?"

I ask

"How far apart are two events in causal space?"


The Butterfly Effect Revisited

The classical butterfly effect suggests that a very small action may eventually produce a very large consequence.

Butterfly
      ↓
small disturbance
      ↓
many intermediate events
      ↓
Tornado
Enter fullscreen mode Exit fullscreen mode

The interesting observation is that although the temporal separation is large, there still exists a continuous causal chain.

This led me to ask:

Can causal influence itself have a measurable distance?


A Directed Bipartite Causal Graph

I define the causal graph as

[
G=(U\cup W,E)
]

where

  • (U) represents causes,
  • (W) represents effects,
  • (E) represents directed causal edges.

Unlike a conventional graph, causes never directly connect to other causes, and effects never directly connect to other effects.

Only

[
E\subseteq U\times W
]

are permitted.

This naturally models causal systems.


Two-Coloured Causal Relationships

Every possible relationship is classified using two colours.

Define

[
\chi(u,v)=
\begin{cases}
1;(\text{blue}), & \text{a permitted causal path exists}\
0;(\text{red}), & \text{no permitted causal path exists}
\end{cases}
]

Blue represents causal reachability.

Red represents causal separation.

Therefore

[
E_B=E
]

and

[
E_R=(U\times W)\setminus E
]

with

[
E_B\cap E_R=\varnothing
]

and

[
E_B\cup E_R=U\times W.
]

Every possible cause-effect pair belongs to exactly one category.


Causal Signatures

Each node is represented by a binary causal signature

[
\sigma(v)=
\left[
\chi(v,z_1),
\chi(v,z_2),
\dots,
\chi(v,z_n)
\right].
]

Rather than storing only neighbouring nodes, the signature represents the causal relationships of the node across the graph.


Hamming Causal Distance

The causal difference between two nodes is defined as the Hamming distance between their causal signatures:

[
\boxed{

d_H^C(x,y)

\sum_{k=1}^{n}
\left|
\sigma_k(x)-\sigma_k(y)
\right|
}
]

This measures how many causal relationships differ.

Example:

[
\sigma(x)=[1,0,1,1]
]

[
\sigma(y)=[1,1,0,1]
]

Therefore

[

d_H^C(x,y)

|1-1|+|0-1|+|1-0|+|1-1|
=2.
]

The two nodes differ in exactly two causal relationships.


Reachability

Direct adjacency alone is insufficient.

Instead, I define causal reachability.

[
A(u,v)=
\begin{cases}
1,&(u,v)\in E\
0,&(u,v)\notin E
\end{cases}
]

A path

[
P(u,v)=
(v_0=u,v_1,\dots,v_m=v)
]

exists whenever

[
(v_i,v_{i+1})\in E
]

for every edge.

Reachability is therefore

[
R(u,v)=
\begin{cases}
1,&\exists P(u,v)\
0,&\text{otherwise}
\end{cases}
]

Blue edges correspond to

[
\chi(u,v)=R(u,v).
]


The Hamming Path

I define a Hamming Path as

[
P_H=(v_0,v_1,\dots,v_m)
]

where every consecutive pair satisfies

[
\boxed{
d_H^C(v_i,v_{i+1})=1
}
]

This means that every transition changes exactly one causal relationship.

The total path length is

[

L_H(P_H)

\sum_{i=0}^{m-1}
d_H^C(v_i,v_{i+1}).
]

The causal distance between two nodes becomes

[
\boxed{

D_C(s,t)

\min_{P_H:s\leadsto t}
L_H(P_H)
}
]

and

[
D_C(s,t)=\infty
]

when no valid causal path exists.

Therefore,

[
\chi(s,t)=
\begin{cases}
\text{blue},&D_C(s,t)<\infty\
\text{red},&D_C(s,t)=\infty.
\end{cases}
]


Formal Definition

The complete model is

[
\boxed{
\mathcal{H}_C=
(G,\chi,\sigma,d_H^C,D_C)
}
]

where

[
G=(U\cup W,E)
]

[
\chi(u,v)\in{\text{blue},\text{red}}
]

[
\sigma(v)\in{0,1}^{|V|}
]

[

d_H^C(x,y)

\sum_k|\sigma_k(x)-\sigma_k(y)|
]

and

[

D_C(s,t)

\min_{P:s\leadsto t}
\sum_{(x,y)\in P}d_H^C(x,y).
]


Why I Call It a Causality Model

Classical Hamming distance counts differing bits.

My proposal uses the same mathematical principle, but applies it to causal signatures embedded within a directed bipartite graph.

In this framework, Hamming distance becomes a metric over causal relationships rather than binary strings.

The objective is not merely to determine whether two events are connected, but to measure how causally distant they are.


Future Work

This article introduces the mathematical foundation.

Future work will explore:

  • Temporal causal graphs
  • Semantic clustering
  • Bayesian causal inference
  • Timeline reconstruction
  • MMUCO OS verification
  • NSIGII integration
  • Causal graph search algorithms
  • Distributed causal verification

Ultimately, I believe causal reasoning should become a first-class computational primitive, just as shortest-path algorithms became fundamental to graph theory.


Closing Thoughts

This work represents another step in the OBINexus research programme.

I do not see operating systems as merely software that schedules processes or manages memory. I see them as systems that reason about relationships, knowledge, verification, and causality.

The Hamming Distance Causality Model is my attempt to provide a mathematical language for measuring those relationships.

Whether this framework evolves into a new graph metric, a verification protocol, or a component of MMUCO OS, the central idea remains the same:

If causality can be represented, then causality can be measured.

— Nnamdi Michael Okpala (OBINexus)

Top comments (0)