# A simple multiway example: radioactive decay

**URL:** <https://community.wolfram.com/t/a-simple-multiway-example-radioactive-decay/19202>\
**Category:** Staff Picks\
**Tags:** chemistry, physics, discrete-mathematics, graphics-and-visualization, graphs-and-networks, staff-pick\
**Created:** [December 1, 2021, 4:05pm UTC](https://community.wolfram.com/t/a-simple-multiway-example-radioactive-decay/19202 "2021-12-01T16:05:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bradklee](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/bradklee/32/16606_2.png) [@bradklee](https://community.wolfram.com/u/bradklee)\
**Post date:** [December 1, 2021, 4:05pm UTC](https://community.wolfram.com/t/a-simple-multiway-example-radioactive-decay/19202/1 "2021-12-01T16:05:49Z")

</div>

In a recent [Blog Post](https://www.wolframphysics.org/bulletins/2021/10/multicomputation-with-numbers-the-case-of-simple-multiway-systems/) Stephen Wolfram showed that a lot of interesting geometry can be created just by iterating a simple function. The spirals are neat, some even seem to be [works of art](https://content.wolfram.com/uploads/sites/32/2021/10/1011sw1005img290.png). It isn’t immediately clear what a graph object has to do with science, so undergrads are left wanting more explanation. What is the simplest case where multi-computational paradigm can be applied to a textbook physics problem? One obvious candidate is Radioactive decay of Carbon atoms.

Say we have an array of ^{14}C atoms, and count N of them at time t=0. After about 5,700 years, we can expect to find about N/2 have decayed to nitrogen. Assuming atoms decay sequentially, how many possible paths through configuration space can we take? The simple answer is to choose N/2 from N and take all possible permutations via the factorial function,

```
(*N = 2, 4, 6 . . . *)
In[]:= Binomial[2 #, #] (#!) & /@ Range[6]
Out[]= {2, 12, 120, 1680, 30240, 665280}

```

And of course, this sequence is [known on OEIS](https://oeis.org/A001813). To introduce a graphical method, we will instead sum over paths on a multiway graph. Represent a valid state as a list of 1’s or 0’s, with 1 standing for Carbon, and 0 standing for nitrogen. The iterator through configuration space decays exactly one Carbon atom in all possible ways.

```
Iterate[state_] := With[{locs = Position[state, 1][[All, 1]]},
  ReplacePart[state, # -> 0] & /@ locs]

Decay[nInt_] := NestList[Union[Flatten[Iterate /@ #, 1]] &,
  {Table[1, {nInt}]}, nInt]

```

Examining the output of any given call to **Decay[n]**, we notice that counting states in a particular generation follows a row of Pascal’s triangle

```
PascalsTriangle[nInt_] := Table[Length /@ Decay[i], {i, 0, nInt}]
PascalsTriangle[10] // TableForm

```

 ![pascaltriangle.png](https://global.discourse-cdn.com/wolfram/original/2X/8/85cf42cd5fa952b7859ff391b1b5e691b99288db.png)

This is a useful fact when plotting

```
IntEdgeMap[nInt_] := 
  MapIndexed[#1 -> #2[[1]] &, 
   SortBy[Tuples[{1, 0}, nInt], -Total[#] &]];

DecayEdges[nInt_] := ReplaceAll[Flatten[Outer[If[
        HammingDistance[#1, #2] == 1, DirectedEdge[#1, #2], {}] &,
      #[[1]], #[[2]], 1] & /@ Partition[Decay[nInt], 2, 1]],
  IntEdgeMap[nInt]]

vertexSort[nInt_] := With[{offset = Divide[Max[#] - #, 2]
      &@PascalsTriangle[nInt][[-1]]},
  {#[[1]] + 
      offset[[#[[2]]]], (1 - #[[2]])/nInt Binomial[nInt, 
       Floor[nInt/2]]} & /@
   
   Map[Reverse[Position[Decay[nInt], #][[1]]] &,
    SortBy[Tuples[{1, 0}, nInt], -Total[#] &]]]

DecayGraph[nInt_] := 
 With[{HLs = nInt - NestWhileList[#/2 &, nInt, # > 1 &]},
  Show[Graphics[Line[{{0, - # Binomial[nInt, Floor[nInt/2]]/nInt },
        {Binomial[nInt, Floor[nInt/2]] + 1,
         - # Binomial[nInt, Floor[nInt/2]]/nInt }}] & /@ HLs],
   Graph[DecayEdges[nInt], VertexCoordinates -> vertexSort[nInt]]]]

GraphicsGrid[Map[Show[#, ImageSize -> 200] &,
  Partition[DecayGraph /@ Range[1, 8], 4], {2}]]

```

 ![decay.jpg](https://global.discourse-cdn.com/wolfram/original/3X/9/4/946291eabbb63fac22b4d3b9a84b866d35fdebd7.jpeg)

Now let’s examine features of these graphs, particularly even cases. Horizontal lines mark successive half-lives, and the first half life (for even cases) always intersects a row of \binom{2n}{n} nodes with excatly n edges directed into each node. If we follow the branching structure back to the root, we see that, on each preceding level, nodes have one less input. Thus we can derive the formula, that number of unique paths to one half life, a(n) = \binom{2n}{n}n!=\frac{(2n)!}{n!}.

Another interesting question is about the profile of state space:

```
PascalDist[nInt_] := MapIndexed[{#2[[1]]/(nInt + 2), #1} &, 
  PascalsTriangle[nInt][[-1]]/Binomial[nInt, Floor[nInt/2]]]

ListLinePlot[PascalDist[2 #] & /@ Range[6], 
 PlotRange -> {{0, 1}, Automatic}, ImageSize -> 500]

```

 ![Profile.png](https://global.discourse-cdn.com/wolfram/original/3X/4/8/48586c91330542dbd7e39efbddf85a0dda5715c3.png)

Does this limit tend to a definite shape? If yes what?

---

<div class="post-metadata">

**Author:** ![wolframcommunity](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/wolframcommunity/32/8335_2.png) [@wolframcommunity](https://community.wolfram.com/u/wolframcommunity)\
**Post date:** [December 1, 2021, 5:28pm UTC](https://community.wolfram.com/t/a-simple-multiway-example-radioactive-decay/19202/2 "2021-12-01T17:28:53Z")

</div>

![news-congrads-kkluyshnik-02-04-19.jpg](https://global.discourse-cdn.com/wolfram/original/3X/6/a/6a310c2d0904616faf4e6e148260c9f29ab9f4eb.jpeg) – you have earned _ **Featured Contributor Badge** _ ![2015-11-02_10-07-11.png](https://global.discourse-cdn.com/wolfram/original/3X/5/0/50e59c9ead62f729e7130d3ea1482555a75602b6.png)  
Your exceptional post has been selected for our editorial column _ **Staff Picks** _ [http://wolfr.am/StaffPicks](http://wolfr.am/StaffPicks) and [Your Profile](http://community.wolfram.com/web/bradklee) is now distinguished by a _ **Featured Contributor Badge** _ and is displayed on the [Featured Contributor Board](https://community.wolfram.com/people). Thank you!
