Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
FamDav
Mar 29, 2008

prefect posted:

is this a religious thing, or was there some guy named church who thought them up?

nah its encoding numbers in lambda calculus.

i made my list in order of importance btw

Adbot
ADBOT LOVES YOU

nrook
Jun 25, 2009

Just let yourself become a worthless person!
wait, what's the difference between p-adic numbers and p-ary numbers except that you get cool algebraic properties from p being a prime

like, 13.5 in binary is

code:
1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 + 1 * 2^-1
and 13.5 as a 2-adic number is...

code:
(1 * 2^4 + 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0) * 2^-1
which... seems pretty similar

this poo poo is cool though

coaxmetal
Oct 21, 2010

I flamed me own dad
I feel like floating point should be higher on the list. Its probs more important than arbitrary precision, since for a lot of common applications arbitrary precision doesn't matter and floating point math is a thing computers do better. Like graphics and poo poo.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

OBAMA BIN LinkedIn posted:

i knew a guy who at university tried to rewrite jquery for a coursework. instead of using jquery.

that's a decent way to learn what's going on in jquery

just never, ever use the rewrite you create

X-BUM-RAIDER-X
May 7, 2008

prefect posted:

just never, ever use the rewrite you create

well the thing was he wrote it to use in his project, which actually had nothing to do with rewriting jquery at all

double sulk
Jul 2, 2010

prefect posted:

that's a decent way to learn what's going on in jquery

just never, ever use the rewrite you create

every-javascript-library.txt

uG
Apr 23, 2003

by Ralp
if javascript is so great why isnt anything important done with it?

tef
May 30, 2004

-> some l-system crap ->

prefect posted:

is this a religious thing, or was there some guy named church who thought them up?

it's because functional programmers believe in the separation of church and state

FamDav
Mar 29, 2008

nrook posted:

wait, what's the difference between p-adic numbers and p-ary numbers except that you get cool algebraic properties from p being a prime

like, 13.5 in binary is

code:
1 * 2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0 + 1 * 2^-1
and 13.5 as a 2-adic number is...

code:
(1 * 2^4 + 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 1 * 2^0) * 2^-1
which... seems pretty similar

this poo poo is cool though

2's complement is just restricting 2-adic integers to a finite number of bits and considering the leftmost bit infinitely many repetitions of that bit.

edit: which sounds like a really douchey thing to say but really those are the rules, its how it works, blah blah blah

Ronald Raiden posted:

I feel like floating point should be higher on the list. Its probs more important than arbitrary precision, since for a lot of common applications arbitrary precision doesn't matter and floating point math is a thing computers do better. Like graphics and poo poo.

probably

FamDav fucked around with this message at 19:05 on Jun 9, 2013

coaxmetal
Oct 21, 2010

I flamed me own dad

tef posted:

it's because functional programmers believe in the separation of church and state

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

tef posted:

it's because functional programmers believe in the separation of church and state

nrook
Jun 25, 2009

Just let yourself become a worthless person!

FamDav posted:

2's complement is just restricting 2-adic integers to a finite number of bits and considering the leftmost bit infinitely many repetitions of that bit.

edit: which sounds like a really douchey thing to say but really those are the rules, its how it works, blah blah blah


probably

idgi

11111111 = -1

but as a 2-adic number

...11111111 = sum from 0 to infinity of 2^n = +inf

?

or, wait, never mind--- it's a limit over two variables, not one, isn't it? a "2-adic number" of arbitrary size can be defined as just the limit of a 2-adic number mod 2^k, where k -> infinity

and in all of those guys, the string of all 1s is going to be -1

I think I get it right now but I probably dont, is there a decent paper or something on arxiv I can read to understand this

FamDav
Mar 29, 2008
http://www.madore.org/~david/math/padics.pdf is a paper

Socracheese
Oct 20, 2008

i already learned all that stuff and forgot it welp cya later

a_pineapple
Dec 23, 2005


code:
#include <iostream>
int gasthreadbanOp;

for (int posts = 0; n < (1/0); n++) {
	if (posts > 0) {
		gasthreadbanOp = true;
	}
	else {
		cout << "lol\n";
	}
}

cowboy beepboop
Feb 24, 2001

Socracheese posted:

i already learned all that stuff and forgot it welp cya later

uG
Apr 23, 2003

by Ralp

vas0line posted:

code:

#include <iostream>
int gasthreadbanOp;

for (int posts = 0; n < (1/0); n++) {
	if (posts > 0) {
		gasthreadbanOp = true;
	}
	else {
		cout << "lol\n";
	}
}

you didn't declare n idiot

Doc Block
Apr 15, 2003
Fun Shoe

prefect posted:

is this a religious thing, or was there some guy named church who thought them up?

I think he means Roman Numerals

Bloody
Mar 3, 2013

FamDav posted:

if you job a computer these are the representations of numbers you should know

1) binary
2) 2-adic
3) some kind of arbitrary-precision type
3) IEEE floats/doubles
4) church numerals

1 well duh
2 this is some sort of nerdy way to say 2s complement? okay i guess
3 lol we're gonna ignore the first 3
3 ieee754 duh yeah i mean dont need it memorized but you should know it exists and vaguely how it works
4 what the gently caress is this poo poo get out

FamDav
Mar 29, 2008
if you do any kind of scientific computing or graphics work, knowing how to write numerically stable code makes you less awful.

and church numerals are:

0 = \x.\f.x
1 = \x.\f.f x
2 = \x.\f.f (f x)

etc.

Bloody
Mar 3, 2013

FamDav posted:

if you do any kind of scientific computing or graphics work, knowing how to write numerically stable code makes you less awful.

and church numerals are:

0 = \x.\f.x
1 = \x.\f.f x
2 = \x.\f.f (f x)

etc.

what the gently caress is this

do you really consider that a valid explanation

lmao

FamDav
Mar 29, 2008

Bloody posted:

what the gently caress is this

do you really consider that a valid explanation

lmao

how about they are an embedding of the integers into the lambda calculus using the properties of function application

lets describe the number N as the result of N applications of a function f to a value x. so

0 = λf.λx.x
1 = λf.λx.f x
2 = λf.λx.f (f x)

i even looked up the lambda symbol so it looks nice

lets write another function λa.λb.λf.λx.a f (b f x), which is plus. this works because if a is f applied A times and b is f applied B times, then this applies f A+B times. wow, whoa

we can write multiply by λa.λb.λf.λx.a (b f) x because this is the application of b (which is the application of f B times) A times

i leave exponentiation and subtraction as an exercise to the reader

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

FamDav posted:

how about they are an embedding of the integers into the lambda calculus using the properties of function application

weird
Jun 4, 2012

by zen death robot
lol if you've never seen Church numerals before

uG
Apr 23, 2003

by Ralp
i wonder how many people have seen both church numerals and the genitalia of the opposite sex??

Posting Principle
Dec 10, 2011

by Ralp

uG posted:

i wonder how many people have seen both church numerals and the genitalia of the opposite sex??

Lots, usually on the same monitor

Plastic Snake
Mar 2, 2005
For Halloween or scaring people.

Jerry SanDisky posted:

Lots, usually on the same monitor

Nice!

Doc Block
Apr 15, 2003
Fun Shoe

Jerry SanDisky posted:

Lots, usually on the same monitor

double sulk
Jul 2, 2010

Jerry SanDisky posted:

Lots, usually on the same monitor

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

Jerry SanDisky posted:

Lots, usually on the same monitor

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik

Jerry SanDisky posted:

Lots, usually on the same monitor

NICE

qntm
Jun 17, 2009

FamDav posted:

how about they are an embedding of the integers into the lambda calculus using the properties of function application

lets describe the number N as the result of N applications of a function f to a value x. so

0 = λf.λx.x
1 = λf.λx.f x
2 = λf.λx.f (f x)

i even looked up the lambda symbol so it looks nice

lets write another function λa.λb.λf.λx.a f (b f x), which is plus. this works because if a is f applied A times and b is f applied B times, then this applies f A+B times. wow, whoa

we can write multiply by λa.λb.λf.λx.a (b f) x because this is the application of b (which is the application of f B times) A times

i leave exponentiation and subtraction as an exercise to the reader

and this is useful because

X-BUM-RAIDER-X
May 7, 2008

Bloody posted:

what the gently caress is this

do you really consider that a valid explanation

lmao

lmao if you can't figure this out on intuition alone

oh wait im in the wrong thre\d

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
Church encoding (Unary basically) is sort of useful in theorem proving systems since they're naturally inductive and so are linked lists


They're are really useful for type level naturals to allow safe indexing and the like.

p-adic numbers are exotic to most mathematicians so lol if you think joe programmer needs to know them

the correct list is

1. Binary numbers in 2's complement
2. IEEE 754-2008 and its algebraic properties
3. Church numerals if u really need them

MononcQc
May 29, 2007

qntm posted:

and this is useful because

It's been a while since I've read on that so I might be wrong, but Church numerals are basically equivalent to Peano arithmetics, which are proven to be complete and undecidable and also mean that you can express pretty much any logical system you want with it. It basically yells you lambda calc can be equivalent to any other similar logical system (ZF set theory and whatnot).

It's fairly important to guys like Douglas Hofstadter who love that poo poo, and mathematicians that used it in whatever proof system they wanted to make stuff progress, I guess.

FamDav
Mar 29, 2008
The correct answer is to make a blog post about it and throw it up on Hn.

MeruFM
Jul 27, 2010
Before knowing all that, programmers should first learn to shower at least once every other day.

But that's not gonna happen so onwards with the masturbatory number conversions. I think hex is pretty cool and also make pretty colors.

X-BUM-RAIDER-X
May 7, 2008

MeruFM posted:

Before knowing all that, programmers should first learn to shower at least once every other day.

But that's not gonna happen so onwards with the masturbatory number conversions. I think hex is pretty cool and also make pretty colors.

at least once a day or get out

JawnV6
Jul 4, 2004

So hot ...
look its obviously
1. reasonable suggestion
2. extended learning
3. lol wacky poo poo from my discipline that im too blind to look above

also count hex on your fingers and make logical operations e-z

Adbot
ADBOT LOVES YOU

MononcQc
May 29, 2007

if this is the case I recommend that being able to implement peano numbers or the equivalent of church-numerals from pi-calc is a good basic requirement in order to be good at concurrent/distributed/actor stuff.

  • Locked thread