A Programmer's Thought Experiment About a Pulsing Universe

I keep coming back to one question whenever I read about the end of the universe:

What if the Big Bang wasn't really the beginning?

Not in the sense that there was simply “something before it.”

I mean something slightly different.

What if the Big Bang was one phase of a much larger process?

What if the universe expands, reaches some enormous turning point, contracts, reaches another extreme, and expands again?

And what if this has happened before?

Maybe once.

Maybe a thousand times.

Maybe so many times that asking which Big Bang was “the first” stops being a useful question.

I'm not a physicist. I'm a software developer who happens to spend an unreasonable amount of time thinking about space, time, cosmology and things that are probably much larger than my PHP applications.

So I'm not presenting this as a new law of physics.

I'm treating it the way I would approach an unfamiliar system in software:

build the simplest possible model, see what it implies, find where it breaks, and then ask better questions.

And the model that has been stuck in my head looks a lot like a pulse.


The Big Bang may not need to be the first event

The popular picture of the Big Bang is wonderfully simple:

Nothing.

Then bang.

Then universe.

Actual cosmology is considerably less tidy.

The Big Bang model describes an early universe that was extraordinarily hot and dense and subsequently expanded. Extrapolating our equations backward leads toward conditions where our current physics becomes incomplete.

That distinction matters.

Saying:

“Our observable universe was once extremely hot and dense.”

is not quite the same statement as:

“We have proved that absolutely nothing existed before that moment.”

And physicists have been exploring alternatives for decades.

Paul Steinhardt and Neil Turok, for example, developed cyclic cosmological models in which cosmic epochs repeat, moving from expansion toward contraction and eventually another bang.

Roger Penrose's Conformal Cyclic Cosmology takes a very different route. In CCC there is no ordinary Big Crunch. Instead, the unimaginably distant future of one cosmic “aeon” is mathematically connected to the Big Bang of the next.

More recently, researchers have continued exploring bounce models in which the Big Bang is not necessarily an absolute beginning at all.

So the basic idea of a universe existing through more than one cosmic era is definitely not mine.

But reading about these models led me to picture the whole thing in a slightly different way.


I started imagining the universe as one incredibly slow pulse

Forget human timescales for a moment.

Actually, forget geological timescales too.

Imagine being able to observe the universe from a completely impossible perspective, with billions or trillions of years compressed into seconds.

Galaxies separate.

Space expands.

The universe becomes larger.

Eventually the expansion reaches some transition.

Then the direction changes.

Distances begin decreasing.

The universe contracts.

It reaches some minimum state.

And then:

Expansion again.

If that happened repeatedly, the entire history might look less like a line and more like a waveform.

Something like this:

minimum        maximum        minimum        maximum
   ●--------------●--------------●--------------●
    \            / \            / \            /
     \          /   \          /   \          /
      expansion     contraction

Calling this a pulsing universe is useful to me because it immediately changes how I picture the Big Bang.

The Big Bang stops being:

BEGINNING → universe → END

and becomes:

... → contraction → BOUNCE → expansion → contraction → BOUNCE → ...

The “bang” is no longer necessarily creation.

It is a transition.

That is the central idea of my thought experiment.


Why I use the word “pulse”

There's an important clarification here.

I'm not claiming that the universe literally behaves like a pulsar.

An astronomical pulsar is a rotating neutron star whose radiation can appear to us as extremely regular pulses. That's a completely different physical system.

I'm borrowing the word only because I like what it communicates visually:

periodicity.

A repeating cosmic rhythm.

And unlike an actual pulsar, the hypothetical period here would be absurdly long.

If one complete cosmic pulse lasted hundreds of billions, trillions, or vastly more years, a civilization could exist for its entire history while observing only a tiny portion of the curve.

Imagine looking at this:

                         .
                      .
                   .
                .
             .
          .
       .

and trying to determine whether it belongs to a line, a circle or a wave.

That's roughly the problem.

We occupy a tiny temporal window.


As a programmer, I wanted to make it executable

This is where my brain naturally leaves the physics department and walks into the code editor.

Instead of immediately writing a complicated cosmological equation, I asked a simpler question:

What is the smallest program that expresses the idea?

We need a value representing the relative scale of the universe.

Let's call it scale.

It needs:

  • a minimum value,

  • a maximum value,

  • a cycle duration,

  • and time.

Then we can create a simple oscillation.

In PHP:

<?php

function universeScale(
    float $time,
    float $minimumScale,
    float $amplitude,
    float $cycleDuration
): float {

    $omega = (2 * M_PI) / $cycleDuration;

    return $minimumScale
        + ($amplitude / 2)
        * (1 - cos($omega * $time));
}

This tiny function produces something interesting.

At the beginning of a cycle:

scale = minimum

Then:

minimum
   ↓
expansion
   ↓
maximum
   ↓
contraction
   ↓
minimum

And then the same process starts again.

Or, in programmer language:

while (true) {
    expand();
    reachMaximum();
    contract();
    bounce();
}

Obviously, the universe does not run PHP.

Probably for the best.

But the code captures the logical structure of the idea surprisingly well.


The code is not the physics

This distinction is probably the most important part of this entire article.

Writing:

cos($omega * $time)

does not explain why the universe would reverse its expansion.

I've only programmed the behavior I want to investigate.

That's very different from deriving that behavior from physics.

It's similar to programming:

$apple->fall();

That doesn't explain gravity.

It merely tells the simulation what gravity is supposed to make the apple do.

A real cosmological model has to answer much harder questions.

What causes contraction?

What happens to entropy between cycles?

What prevents everything from reaching an actual singularity?

What happens to black holes?

What happens to matter and radiation?

What physical mechanism produces the bounce?

And perhaps most importantly:

Why should the universe turn around at all?

That's where my simple model runs directly into modern cosmology.


There is an inconvenient problem: the universe is accelerating

Observations indicate that cosmic expansion is currently accelerating.

In the standard ΛCDM cosmological model, dark energy behaves approximately like a cosmological constant.

If that remains true forever, my simple expand-contract-repeat picture has a major problem.

The universe doesn't turn around.

It keeps expanding.

However, there is an interesting wrinkle.

Results released by DESI in 2025 strengthened hints that dark energy might not be perfectly constant. When DESI measurements are combined with other cosmological observations, some combinations prefer models in which dark energy evolves with time. This is intriguing, but it is not a discovery that dark energy definitely changes, and certainly not evidence that the universe will eventually contract.

That's an important distinction.

Still, it makes the question more interesting.

If dark energy can evolve, then the long-term behavior of cosmic expansion becomes a more open problem than a perfectly constant Λ would suggest.

My thought experiment therefore requires something stronger:

dark energy changes
        ↓
accelerated expansion eventually weakens
        ↓
some mechanism allows contraction
        ↓
contraction reaches a non-singular minimum
        ↓
bounce
        ↓
new expansion

I don't currently have the physics that proves those arrows.

That's the missing part.

And I think admitting that makes the experiment more interesting, not less.


Entropy is another problem I can't just code away

There's another nasty issue.

The second law of thermodynamics.

Entropy tends to increase.

So if every universe simply collapses and starts again while carrying all of its entropy with it, each cycle shouldn't necessarily be an identical clean reset.

This has been one of the central difficulties faced by cyclic cosmologies.

Different models attempt to deal with it differently.

Steinhardt and Turok's cyclic framework, for example, uses an extended period of accelerated expansion as part of the mechanism that prepares conditions for another cycle.

Penrose's CCC approaches the problem completely differently, connecting the remote future of one aeon to the beginning of another through conformal geometry rather than an ordinary collapse and rebound.

My little PHP loop cheats:

while (true) {
    expand();
    contract();
}

Nature doesn't get to cheat.

A serious version of this idea would need an entropy strategy.


So what exactly am I proposing?

Not that I've discovered how the universe works.

Not that existing cyclic cosmology is wrong.

And definitely not that a cosine function written by a software developer has replaced general relativity.

My idea is much more modest.

I'm exploring this possibility:

The observable expansion of our universe may represent only one phase of an enormously long recurring cosmic process, in which Big Bang-like events act as transitions between cycles rather than unique moments of absolute creation.

I visualize that process as a pulse.

Expansion is one side of the pulse.

Contraction is the other.

The bounce connects them.

And our entire observable cosmic history could occupy only a small section of one enormous waveform.

In its simplest conceptual form:

Universe {
    previousCycle();
    contract();
    bounce();       // what we call a Big Bang?
    expand();       // where we currently are
    reachMaximum();
    contract();
    nextCycle();
}

The question mark beside bounce() is intentional.

That's the part I don't know.


There may never have been a “first” Big Bang

This is the part that fascinates me most.

Suppose the cycle really has no beginning.

Then asking:

“What happened before the Big Bang?”

would have an answer.

Another cosmic era.

And asking what happened before that would produce the same answer again.

Not turtles all the way down.

Universes all the way back.

... Cycle -2
       ↓
     bounce
       ↓
    Cycle -1
       ↓
     bounce
       ↓
  OUR UNIVERSE
       ↓
     bounce
       ↓
    Cycle +1 ...

There would be no privileged Big Bang.

Ours would simply be the one behind us.

That also means the next Big Bang — if such a cycle exists — would not represent the creation of something from nothing.

It would be the next state of something already happening.


The recent research makes the question even more fun

One reason I finally decided to write this down is that modern cosmology keeps making the simple “Big Bang equals absolute beginning” picture less satisfying.

Cyclic models have existed for decades. Penrose has developed an entirely different cyclic picture. Bounce cosmologies continue to be investigated. Recent work has even explored scenarios in which our expanding universe could emerge from gravitational collapse associated with a black-hole-like parent structure.

None of these proves my picture.

They don't even all agree with each other.

In fact, some are mutually very different.

But together they illustrate something I love about cosmology:

“What came before?” is still a scientifically interesting question.

And we don't yet have the final answer.


What would make this more than a thought experiment?

This is where I would take the project next.

My PHP function defines a shape:

scale(time)

Physics would need to explain why that shape emerges.

Instead of saying:

$scale = pulse($time);

we eventually need something closer to:

$state = evolveUniverse(
    matter: $matter,
    radiation: $radiation,
    darkEnergy: $darkEnergy,
    curvature: $curvature,
    entropy: $entropy,
    gravity: $gravity
);

$scale = $state->scale;

Then the interesting test becomes:

Does pulsation emerge without explicitly programming pulsation?

That would be a completely different level of experiment.

If the simulated universe naturally expands, turns around, contracts, avoids a singularity and expands again under a physically defensible set of rules, then we have something worth studying much more seriously.

If it doesn't?

That's useful too.

One of my favorite things about code is that it has very little respect for beautiful ideas.

Eventually you have to run them.


For now, I like the question more than the answer

I don't know whether the universe pulses.

Current observations certainly don't demonstrate that it does.

And existing cyclic cosmologies contain decades of mathematics far beyond the tiny conceptual simulation I've written here.

But that's not really why I wanted to write this.

The interesting realization for me was simpler:

I had always subconsciously pictured the Big Bang as the left edge of a timeline.

Then I moved it into the middle.

Before ←──── Big Bang ────→ After

Once you do that, a surprisingly large number of questions appear.

Maybe the Big Bang was the beginning.

Maybe it was a bounce.

Maybe Penrose's aeons are closer to reality.

Maybe the universe expands forever and there is never another contraction.

Or maybe our entire observable universe is currently moving through one almost imperceptibly slow part of a cosmic pulse whose complete period is far beyond anything humanity will ever witness.

I don't have an answer.

I have a model small enough to fit inside a few lines of PHP.

And a universe large enough to spend the rest of my life wondering whether those lines are even remotely pointing in the right direction.