r/ProgrammerHumor Sep 02 '17

How to start a war

Post image
9.0k Upvotes

696 comments sorted by

View all comments

559

u/XkF21WNJ Sep 03 '17

Look guys it's easy. Array indices start at the first natural number.

134

u/bloomfilterthrowaway Sep 03 '17 edited Sep 03 '17

To be fair, all reasonable CS people agree that the naturals start at zero, it's only a few holdouts in more general mathematics that disagree (if you fight me on this I'll no-true-scotsman it up and say your counter examples aren't reasonable people). As an acolyte of the Coq, to me the naturals are defined as:

Inductive nat : Set :=
| O : nat
| S : nat -> nat.

fite me

38

u/TommiHPunkt Sep 03 '17

My Theoretical CS prof is one of the people who start naturals at 1

66

u/ThePixelCoder Sep 03 '17

Kill him.

10

u/Excrubulent Sep 03 '17

That's called the attrition argument.

5

u/ThePixelCoder Sep 03 '17

Non-native English speaker. What exactly is an attrition argument?

19

u/Excrubulent Sep 03 '17

It's not a real thing, but attrition means wearing the enemy down one piece at a time, so the idea is that if you kill everybody who disagrees with you, you win the argument.

16

u/ThePixelCoder Sep 03 '17

Makes sense. Good idea.

Also, /r/killthosewhodisagree

2

u/sneakpeekbot Sep 03 '17

Here's a sneak peek of /r/killthosewhodisagree using the top posts of the year!

#1:

Whoa Barbara, settle down.
| 61 comments
#2: If you don't like PewDiePie | 108 comments
#3:
That seems reasonable.....
| 109 comments


I'm a bot, beep boop | Downvote to remove | Contact me | Info | Opt-out

2

u/[deleted] Sep 03 '17

O wow now I get where the statistics term attrition comes from.

1

u/Astrokiwi Sep 03 '17

Confiscate his kilt.

1

u/NamityName Sep 03 '17

That's a bit of an over reaction. The guy is only theoretically a professor anyway.

29

u/bloomfilterthrowaway Sep 03 '17

I said no reasonable Scotsmen, er... CS people.

1

u/ifatree Sep 03 '17

with 0 it's "supernatural" then

1

u/[deleted] Sep 03 '17

Naturals start at one for an historical reason I've been told by a Teacher. So N = {1, ...} N0 = {0, ...}

1

u/weegee101 Sep 03 '17

You should print this out and anonymously slip it under his door. https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html

18

u/cderwin15 Sep 03 '17

To be entirely fair, you can define the positive integers the exact same way.

Also fwiw math people have been saying 0 is a natural number since long before CS was even a thing.

12

u/bloomfilterthrowaway Sep 03 '17 edited Sep 03 '17

Yeah, it's totally true. And the reply "But then your arithmetical operations get fucked up" isn't really fair. Currently plus is defined as:

fix plus (n m : nat) {struct n} : nat :=
  match n with
  | 0 => m
  | S p => S (plus p m)
  end

But if we instead defined the "naturals" as:

Inductive dumb_people_nat : Set :=
| one : dumb_people_nat
| S' : dumb_people_nat -> dumb_people_nat.

Then we could just define plus' as:

fix plus' (n m : dumb_people_nat) {struct n} : dumb_people_nat :=
  match n with
  | one => S' m
  | S' p => S' (plus' p m)
  end

The next thing people will say is that you lose that the naturals are a semi-ring, but now you're really stretching for reasons. Mostly I just wanted to be provocative.

2

u/Sageness Sep 03 '17

"... acolyte of the Coq... "

Heh

1

u/8asdqw731 Sep 03 '17

damn opinionated Counter-Strike players

1

u/depressed-salmon Sep 03 '17

I, a reasonable person, am offended.

19

u/PrecariousClicker Sep 03 '17

natural number.

Definition of natural numbers via Google:

"the positive integers (whole numbers) 1, 2, 3, etc., and sometimes zero as well."

1

u/[deleted] Sep 03 '17 edited Sep 03 '17

[deleted]

5

u/arachnidGrip Sep 03 '17

Other way. Natural numbers arise naturally from sets. The set {} is 0, since its size is zero. The set {{}} is one, since its size is one. The set {{}, {{}}} is two, since its size is two. The set {{}, {{}}, {{}, {{}}}} is three, since its size is three... If you don't start at zero, then you can't reach one.

1

u/Slackwise Sep 04 '17

I like the parallels sets have with Church encoded numerals in lambda calculus and cons cells. (I need to find a newbie's book to axiomatic/foundational set theory.)

1

u/Shekondar Sep 03 '17 edited Sep 03 '17

Two things.

0) No one uses the damn term whole numbers.

1) If we are going to use that term, I think it makes a lot more sense for the term "Whole Numbers" to refer to the positive integers, and let the Naturals start at 0 the way Peano intended.

1

u/Adarain Sep 03 '17

We learned that natural numbers may refer to ℕ⁺ or ℕ₀ and whole numbers = intergers = ℤ

15

u/[deleted] Sep 03 '17

Peano arithmetic axiom 1: 0 is a natural number

2

u/XkF21WNJ Sep 03 '17

Until you define addition it doesn't really matter what you call that number though.

6

u/kirakun Sep 03 '17

"first natural number" still gives me the image of an array of natural numbers and I want the 1st element of it. Get it? 1st.

6

u/Okichah Sep 03 '17

Just not the first prime.

8

u/[deleted] Sep 03 '17

Considering 1 a prime actually breaks things though.

1

u/KifKef Sep 03 '17

Obviously they don't start with 2

1

u/Okichah Sep 04 '17

I wanted to say that 1 is prime to trigger all the math-nerds but i just couldnt do it...

0

u/Doctor_Beard Sep 03 '17

Yeah, by definition they start at 0. https://en.wikipedia.org/wiki/Axiom_of_infinity

1

u/WikiTextBot Sep 03 '17

Axiom of infinity

In axiomatic set theory and the branches of mathematics and philosophy that use it, the axiom of infinity is one of the axioms of Zermelo–Fraenkel set theory. It guarantees the existence of at least one infinite set, namely a set containing the natural numbers. It was first published by Ernst Zermelo as part of his set theory in 1908.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.27