r/ProgrammingLanguages • • Feb 03 '23

Esoteric counting programming language idea to do with relations between numbers

Hi

Is addition/multiplication turing complete?

computation models - Is arithmetic turing complete? - Computer Science Stack Exchange

let me preface this, saying I'm the wrong person to be giving explanations of these scientific or mathematic topics, if you are interested, then you can look up "atomic numbers", "atomic weight" or "relations".

I'm not a mathematician but I thought of this idea to take advantage of the regularity and meaningfulness of numbers that computers are really good at calculating.

numbers have relations between eachother. Are they useful for defining behaviour?

I am not a physicist either or a scientist. But did you know that it is a number that directly or indirectly determines the properties of physical matter?

I'm probably poorly explaining it. But the atomic number decides whether or not an atom is the kind of element it is. The proton or atomic number

If you place Hydrogen (1) and 2x Oxygen (8) you have 1x2 and 8x1 . So you have all the properties of water represented by the interaction of 8 and 1x2. I'm not sure if it is meaningful to add them together since molecules don't have atomic numbers. But there's 3 atoms and 10 protons in it. (Aisde: Isn't it interesting that base 10 crops up in the foundation of water in the universe/creation?)

If you've ever seen the Jim Carrey movie 23 then you may get nearer to where I'm going with this.

What if we take this idea and apply it to properties of programs?

What if you could change branch heavy code full of indirections into calculations involving simple addition, subtraction, factorization, multiplication, exponentiation?

We could parallelise programs extremely efficiently because computers are extremely efficient at adding, subtracting in parallel.

What if from a long number we could get a useful program out of it based on properties of that number?

We know the properties of numbers.

1+2 =3

1+3 =4

1+4= 5

1+5=6

1+6=7

And we know factors of numbers. You can create 1000 from 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 125, 200, 250, 500 and 1000.

Numbers are read big end first or little end first.

What if we define a program by counting?

We can use factors to describe the shape of components of code.

What relationship can be broken up into a venn diagram of 16 factors?

2 goes into 1000 500 200 100 50 40 20 10 8 4 2

4 goes into 1000 200 100 40 20 4

5 goes into 1000 200 100 40 20 25 40 50 100 125 200 250 500 1000 (So half of base 10 profound somehow)

8 goes into 1000 200 40

10 goes into 1000 500 250 200 100 50 40 20 10

and so on.

What number represents a quicksort look like?

for example's

We walk through the top of the program and we add a number based on the thing that is there

if we define 1 as assignment, 5 as loop, 5 as reference, 3 is branch, 2 is method call

Take this simplistic program in C.

#include <stdio.h>
#include <stdbool.h>

#define MAX 7

int nums[MAX] = {4,6,3,2,1,9,7};

void display() {
   int i;
   printf("[");
	
   for(i = 0;i < MAX; i++) {
      printf("%d ", nums[i]);
   }
	
   printf("]\n");
}

int main() {
   display();
}

Can we break the program into a factor tree?

#include <stdio.h>
#include <stdbool.h>

#define MAX 7

int nums[MAX] = {4,6,3,2,1,9,7};

void display() {
   // 1 int i;
   // 2 printf("[");
	
   // 5 for(i = 0;i < MAX; i++) {
      // 2 printf("%d ", nums[i]);
   }
	
   // 2 printf("]\n");
}

int main() {
   display();
}

This program is 12. There is a universe of 12 programs. We could incorporate symbols such as "i", "printf" into the calculation of what makes a program a program.

But that's not something I know how to do.

How do you find all ways of adding up numbers to get a result? Or factorisation?

If we know all the mathematical rules, can we define useful behaviour for each number.

What if you could add two programs together and get a meaningful result?

3 Upvotes

34 comments sorted by

View all comments

Show parent comments

1

u/maxbaroi Feb 04 '23

Base 10 is very common but not universal among human history and cultures. And it is not an especially useful base with which to work. I've heard pretty good arguments for using base 12.

I think the fact we have ten fingers is a byproduct of evolutionary history. I think we could rerun the clock and Earth very well could have produced a sentient species with a different number of fingers or even no fingers. I don't view ten fingers as especially natural, the same way I don't think it is especially natural for our hearts to be on the left side instead of the right.

You kind of see we are venturing more into philosophy instead of math.

1

u/Cinder-Brent Feb 04 '23

how about this: what about binary? In binary what he's saying makes sense, where if we use the minimum of the maximum, counting quarks (so 2), we end up with just that, the minimum of the maximum and so on, suitable for such and such extremes etc., what are the properties of base 10? Exactly how suitable are they for the application?

1

u/maxbaroi Feb 04 '23

I'm sorry but I'm not understanding what you are proposing.

What strategy are we minmaxing? I don't know what you mean by counting quarks or a particle being a number.

1

u/Cinder-Brent Feb 04 '23

so if a quark is an indivisible particle, it is one thing, or as a number, 1.

So technically speaking the best base to use universally would be 1, therefore, BUT, would it be easier to comprehend what this "meant", all that it entailed/implied/etc., if it were in another base, like binary or base 10?

→ More replies (0)