r/learnprogramming • • Apr 28 '22

If everything is ultimately binary, does't that just make programs a specific number?

I did the CS50 course a while ago and they covered binary in there. I did binary back in 2006 when I was at college too so understood the logic behind it already. It's either on or off!

When a C program compiles, it goes through it's phases and compiles to assembly and then ultimately machine code i.e binary.

Let's say our program is 5,000,000 pages of 1's and 0's. All of those 1's and 0's make up a single number....albeit a super long number.

Does that mean that the entire Linux operating system, for example, can be represented by an actual number?

If so, why are we not storing programs as a number because that would take up less space than the 5,000 pages of 1's and 0's.

110101000101011111011011111110111100 = 57000443836 in decimal. So why don't we store programs in decimal and convert that to 1's and 0's in real time?

Storage would be much less. Is that how compression works?

These may be crazy questions but it just entered my head earlier when thinking about what the binary of a program can represent.

Even shorter than decimal is HEX.... So why don't we store programs in Hex?

Any help appreciated on this one so I can wrap my head around it.

1.7k Upvotes

346 comments sorted by

View all comments

Show parent comments

-7

u/FountainsOfFluids Apr 29 '22

I would like you to pick a number and then prove pi does not contain it.

28

u/MikeGlambin Apr 29 '22

While choosing a number that it doesn’t contain does prove it doesn’t contain all numbers, the inability to prove it doesn’t contain a number doesn’t mean it contains it and certainly doesn’t mean it contains all possible combination of numbers.

I am not saying it does or doesn’t I am actually now fascinated by the question.

I would love to read an actual proof for either side.

-15

u/FountainsOfFluids Apr 29 '22

My point was that it's a bit shitty to say "No, pi doesn't contain every number" because you can't prove that. So saying that is just as "incorrect" as saying "It contains every number!" only with added condescension.

25

u/Dynam2012 Apr 29 '22

Burden of proof lies on the positive claim.

-20

u/FountainsOfFluids Apr 29 '22

Again, in this situation it's what an asshole says.

There is absolutely no harm in just letting it go.

Yet y'all are choosing to take a big shit in the middle of a fun conversation.

12

u/protienbudspromax Apr 29 '22

Because it is wrong and it is a maybe from both sides until we have a proof for one or the other. Also people had used this pi containing everything as a base to proof other nonsesnse stuff or claim things which are not true. Plus its prevalence in media irks people. Just like thinking CS = fixing printers by media irks programmers.

Not even sure a proof would be possible. But math is math and it is very sure of what it accepts as true or false. As that is the only thing that math does. It cannot accept an inbetween value.

-2

u/FountainsOfFluids Apr 29 '22

Because it is wrong

It's NOT wrong, it's unprovable. Y'all got sticks up yer asses about being "technically correct" but you're not.

9

u/protienbudspromax Apr 29 '22 edited Apr 29 '22

"Because it is wrong (that it is true) and it is a maybe from both sides" of the argument.

"Y'all got sticks up yer asses about being "technically correct"" Because that's what math demands. You are arguing a mathematical thing and then don't follow what math allows. Math is about exactness, and it is why I like it.

1

u/MaxPhantom_ Apr 29 '22

What do you think about Godel's incompleteness theorem, does it make doubts in math

4

u/protienbudspromax Apr 29 '22

But godel kinda used math to prove his incompleteness theorem. It is BECAUSE math is so rigid that this was provable at all. All it really says is there are statements in math that are true but can't be proven. But this also proves that math is internally consistent. A system that is complete will not be internally consistent. It really does gives a lot to think about. At the end of the math too is a model. The best one we have but a model/abstraction none the less.

6

u/66666thats6sixes Apr 29 '22

They didn't say that "pi doesn't contain every number", they said that the infinite and non-repeating nature of pi does not imply that pi contains every number. Yes, their first sentence was to say that it's incorrect to say that pi contains every number, which they then clarify to mean that it's not proven, not that it's necessarily false.

-7

u/[deleted] Apr 29 '22

You can’t prove the non-existence of something.

12

u/schoolmonky Apr 29 '22

You absolutely can, in math at least. For instance, it's pretty obvious there exist no (real) numbers that are both positive and negative.

3

u/[deleted] Apr 29 '22

I’m using it in the layman’s terms. I know the proof of impossibility.

But we don’t know if pi MUST contain every number sequence. I don’t think it does.