Induction and Recursion

zerozero

Superstar
Joined
May 6, 2012
Messages
6,866
Reputation
1,260
Daps
13,497
what's induction?

in practice in programming recursion is best avoided but understanding how it works is really important if you want to have a programming mind
 

semtex

:)
Joined
May 1, 2012
Messages
20,310
Reputation
3,406
Daps
46,195
what's induction?

in practice in programming recursion is best avoided but understanding how it works is really important if you want to have a programming mind
Recursion in programming is easy I'm talkin bout discrete proofs
 

Type Username Here

Not a new member
Joined
Apr 30, 2012
Messages
16,368
Reputation
2,385
Daps
32,643
Reppin
humans
what's induction?

in practice in programming recursion is best avoided but understanding how it works is really important if you want to have a programming mind

Best avoided? Surely in some cases that is true, but outright avoided? Are you talking about recursion elimination using stacks?
 

zerozero

Superstar
Joined
May 6, 2012
Messages
6,866
Reputation
1,260
Daps
13,497
Best avoided? Surely in some cases that is true, but outright avoided? Are you talking about recursion elimination using stacks?

I've never practically needed to use recursion in real world work but maybe the stuff I do is just not hardcore enough lol

well I wrote a recursive function once for directory traversal

I'm just saying if I end up writing some code where I'm doing recursion I'd think twice about whether I'm just trying to be clever or if this is the best thing to do

so I guess my statement was too authoritative sounding, it's just my off-hand opinion, I don't have any hard info for or against using recursion
 

semtex

:)
Joined
May 1, 2012
Messages
20,310
Reputation
3,406
Daps
46,195
It's so annoying u can be good at programming but have to take and pass all these outlandish math courses :aicmon:
 

semtex

:)
Joined
May 1, 2012
Messages
20,310
Reputation
3,406
Daps
46,195
what's induction?

in practice in programming recursion is best avoided but understanding how it works is really important if you want to have a programming mind
Induction is being given P(k) and proving that P(k) implies P(k+1). In theory it seems simple but applying it is a bytch especially if you aren't great at algebra.
 

zerozero

Superstar
Joined
May 6, 2012
Messages
6,866
Reputation
1,260
Daps
13,497
Induction is being given P(k) and proving that P(k) implies P(k+1). In theory it seems simple but applying it is a bytch especially if you aren't great at algebra.

sounds complex :whew: one day I need to go back and learn this stuff
 

null

...
Joined
Nov 12, 2014
Messages
29,635
Reputation
5,109
Daps
46,863
Reppin
UK, DE, GY, DMV
what's induction?

in practice in programming recursion is best avoided but understanding how it works is really important if you want to have a programming mind

neg

often functional languages have no loops i.e. ONLY recursion no iteration possible in the languages.

e.g.

fac (0): 0
fac (n): 1 + fac (n-1)

also:

there are function classes which can only be written recursively.
 

zerozero

Superstar
Joined
May 6, 2012
Messages
6,866
Reputation
1,260
Daps
13,497
neg

often functional languages have no loops i.e. ONLY recursion no iteration possible in the languages.

e.g.

fac (0): 0
fac (n): 1 + fac (n-1)

also:

there are function classes which can only be written recursively.

Okay, you let me know when a billion dollar biz is built on pure Lisp
 

null

...
Joined
Nov 12, 2014
Messages
29,635
Reputation
5,109
Daps
46,863
Reppin
UK, DE, GY, DMV
Okay, you let me know when a billion dollar biz is built on pure Lisp

oddly specific for a logic driven programmer ... :picard:

although it is not the norm for a company to use just one language :mjlol:

1. blockchain: ADA uses haskell



2. backbone telecom routing runs on Erlang incl Whatsapp





3. SQL (core ANSI) is declarative i.e. ignore MS, focus on Codd

the value of SQL in industry is .... incalculable

-

are you still a "programmer" :ld: ?
 
Top