Showing posts with label logic. Show all posts
Showing posts with label logic. Show all posts

30.12.08

why we don't ever debate laymen

so i tried to get through a family visit without starting a fight with any of my, uh, scientifically illiterate relatives... well, i got to the last night before i lost it and ran over a verbal landmine talking to my ma and sis.

they're watching Paranormal Hunters or Ghost Hunt or Mediums Gone Wild or some such shite, with a woman who is quite blatantly cold-reading people for a hundred Euro a pop. me, i'm lying on the floor in a medically useless attempt to alleviate the eighty-year-old's spine in my twenty-year-old fucked-up body, given that neither the codeine (pretty much prescribed with no other purpose than to keep my addiction under control) or the about a half a bottle of irish cream i'd drunk by then could do shit about it, only half paying attention to the conversation. the other half of said attention span is being wasted on trying to devise a test for a real spirit medium that would both be scientifically valid, and at all comprehensible to the layman.

eventually, i get bored. "If she was a real spirit medium," i point out acidically, "she'd be able to give him the messages from his dead mother without him answering any questions. If he sat there and said nothing, she'd be screwed. These people are retarded," and i leave it at that, imagining like the autistic idiot i am that my blood relatives would have the fundaments of logic at least in their minds when considering this shit.

nope. my ma is suddenly looking a whole lot less happy. "I can't believe you're saying that," she says shakily. "Are you calling me retarded?"

see, here's where me and J. Random Neurotypical diverge. the normal thing to do, i learned, would be to go, "No ma, misunderstanding, there are too spirits," apologise, and leave it at that. that's about as far as you can get from what i did.

"Damn right I am," i said, expecting the mental ping-pong of a fun debate with educated people who can take having their beliefs insulted. good holy fuck was that not what it turned out to be.

in the ensuing heated argument, i tried to make the point that although i respect all humans, yeah even rapists and murderers, as humans, i don't have to respect anyone's beliefs. that got them so angry they started to become inarticulate, and seems to have translated into the following in their minds:

"You're wrong because you think differently to me. Ergo you are not allowed to think anything that is wrong, ergo you are worthless. CONFORM TO SCIENCE'S HEGEMONY NOW."

trying to assure them that i don't think difference is bad was utterly futile, as was pointing out that science doesn't dictate, that you can't prove that anything doesn't exist (only that it does), that i don't disagree with them because i don't like their ideas but because there is no evidence for them, etc. i could not get it through to either woman that having blind faith in X irrational concept 'just because you want to', is cognitively fettering yourself.

so i tried to compare it to religion, since they're both non-theists. "How is your belief in the spirit world any different to a Catholic's belief in Heaven?" i asked. by this point my sister, a nineteen-year-old with a hatred of academia, is shouting at me constantly that i'm an asshole and i'm never gonna get anywhere in the world, nobody's ever gonna respect me because i'm a jerk, etc. my ma doesn't answer the question, instead getting more and more upset that i used the word 'retard', saying that it's a kick in the face after all she's done for me and she can't believe i'd be so ungrateful as to call her names. by this point both are in tears, and my sis is trying to shout "It's just your OPINION! It's JUST YOUR OPINION!" over anything i say.

then i really threw the napalm at my stupid ass. "Shut up a second and let her talk," i tell her, trying to get some sort of turn system established so we can all get a fucking word in. turns out neurotypicals prefer the format of debate where the winner is the guy who shouts down all the other guys and is still refusing to listen to their first logical point. she screamed at me that i was a fucking asshole with no future who didn't have any feelings and would never have any friends, and still yelling that she didn't want to even be related to a cunt like me, stormed to her room (she still lives with my ma) and slammed the door. my ma went upstairs in tears to talk to her, still thinking i'd called her retarded and refusing outright to let me explain that i hadn't. and all i was doing was starting a mental fencing match for pocket change; it's as if they suddenly got tired of my fancy prancing, took the balls off the foils and cut the shit out of everyone in the room. nobody 'won', but everyone had to have stitches. i'm pretty much back to square one with trying to make them not hate me now.

and that is why you should never, ever debate people who don't have degrees.

16.12.07

debugger != exterminator

over the years i've learnt the hard way that it's not possible to go through opiate withdrawal and debug Java at the same time. (trust me on this one.) interestingly, i've been seeing quite a few students who can't use a debugger at all - even the shockingly intuitive NetBeans onboard one - and i gotta admit, when you first see it, you're gonna be weirded out if you're not a programmer.

of course, having coded in hospital, on sedatives, with cannulae in both arms, for a good few weeks of my programming lifetime so far, i got a fair amount of sympathy for the kiddies i see trying to wade through their 5000+ lines of Java one by one, trying to find "the bit that won't work". and being the friendly campus opiate addict that i am, i decided to shoulder-surf my way around the lab for a while last week instead of doing my own work, in the hopes of finding out what they were commonly fucking up.

before i get going, don't get no wrong ideas here. i have no problem with people fucking up - i do it myself all the time, and as it's often been stressed over at Coding Horror, everybody fucks up. with that in mind, i found out they were pretty much all doing the same thing.

nobody was debugging their half-finished code. nobody had written either JUnit tests, or little test classes with souts to the console (System.out.println, that is); the main route seemed to be

1. write (usually quite good) code for the entire program
2. run
3. notice bugs, attempt to debug whole program (5+ classes) at once
4. realise sheer monstrosity of task, give up, go for milkshake.
obviously, this isn't exactly the most efficient way to be doing your shit. it's stressful, and more's the problem, it's a total waste of your precious lab hours. it's actually simple to avoid: you just have to run the program after every method, or group of interdependent methods.

that means, your cycle is code method, compile, test, debug, code method. if you gotta write biddy little classes to test your functions, go for it. the time you'll spend writing those is nothing compared to the stress you'd experience trying to work out all the bugs in a program when nothing's been tested, nothing is guaranteed to work and anything could be the problem.

that is, a debugger isn't no exterminator. it's not a flamethrower for removing a huge infestation of glitches, it's a pinpoint laser for picking them off one by one as they arrive; you just gotta keep looking for them, as you go, constantly.

L
(taking out kitchen roaches with a DVD-burning laser)

24.7.07

open thread: evolution, Roger and homo sapiens sapiens

so over at Pharyngula i ended up in a bigass discussion with Roger the Creationist, who won't accept that evolution is a fact, and i offered to start up a debate here (since the original thread is from ages ago).

so, here is an open thread. i'm not expecting anything decent.

actually, pessimism being my premier mindset, i'm not expecting anyfuckingthing. i'm like the antithesis of Deepak Chopra.

Lepht

19.7.07

the ueber-rant

i had a debate with a Philosophy student yesterday. it went like this:

Lepht (on way to coffee shop, having ended up in casual conversation in transit): ... of course, that's a faith-based conclusion, and if that's all she's got -

Student: You know, this thing you've got against faith is something you should really work on before you really insult someone.

Lepht (momentarily taken aback): What? I don't care if I insult people with faith, Harry.

Harry: You should care. You've got to respect it, even if it's not right for you. You always seem to write things off if you disagree with them, just because they're not right for you, and that doesn't seem fair.

Lepht (by now absolutely astounded): It's not that it's "not right for me". It's that faith is based on an absolute lack of evidence. That doesn't make it "not right for me" and "right for some others", it makes it wrong for anyone who lives in the real world. By your logic, everything's right for someone - hell, Nazism is "right for some people". You can't say it's wrong, just "not right for you".

Harry: That's not the same. I'm talking about spirituality, not religion.

{i usually do end up in this kind of fight with students. in this case i ignored his blatant change of subject and went with his next point.}

Lepht: They're both based on faith. Where's the difference? Why should I leave one alone but not the other?

Harry (becoming agitated): No! Religion is, is dogma and rules and regulations. Spirituality is about... (turns away) It's about personal (inaudible).

Lepht: Look, what do you even mean by spirituality?

Harry: They're not the same!

Lepht: But what does the word mean?

he just wouldn't, or couldn't, define "spirituality", or tell me how it was at all different from religious faith, or why i should respect either of them. i've had thousands of these conversations, with all kinds of believer, and none of them can ever tell me why either faith or spirituality deserve respect.

that's it, of course: every human being deserves respect. the human genome is so beautifully adapted, the body such a wonderful product of evolution over an inconceivably long time, that i couldn't conclude otherwise; it's one of my core tenets, that everyone on the planet has a brain worthy of the most complex theories we can imagine, and then some. i respect all people for what they are, no matter how foul and reprehensible their behaviour or stupid their choices.

what i can't respect is their silly, mushy beliefs. i won't sit back and be told that Jesus will save my soul. i won't be sermonised about my immorality. and i won't allow philosophers and Pagans to demand my tolerance of their vague and ill-defined notions of non-religious faith, either, no more than i would tolerate someone touting Peruvian creation myths as truth or trying to stop my security classes because they're against the teachings.

i respect humanity. i serve humanity. but i despise faith, and i'll afford it no tolerance.

it doesn't deserve tolerance.

Lepht
(about to be blown off the face of the earth by angry Pagans)

7.7.07

of Vista and pot plants

Vista has proven remarkably adaptive to the Toshiba's hardware, which i still suspect was made for it. i don't like OS-specific hardware: to me it seems to be violating users' basic choice over OS, and it puts a hell of a strain on open-source users to either find compatible drivers, deal with the Rubik's cube of ndiswrapper and MadWifi installs under Linux (assuming those are even applicable, which they're sometimes not) or write their own (no, i'm not good enough to do that).

that, and other good points with dark sides, mean i can't write off Vista as the memory-hogging, shiny-fronted, dubious-underbellied OS it really is. for instance, i like the tree view in folders, i like my hardware working, i like Windows Sidebar (although Tomboy Notes for GNOME is better) and i love the wallpapers. Aero is beautiful, but slow as fuck on a limited system; i can just run it, but not for long, i think. and of course, it being Windows, all kinds of external security apps, additions and fixes become necessary. i'm still undecided, though; more later.

on, then, to today's cool thing: a simple way to get students started with propositional logic. this is the Pot Plant Problem.

you want your students to determine whether these two propositions are logically equivalent:

x: If it has rained and it's been cold, then the plant is dead.
y: If it has rained, then either it hasn't been cold or the plant is dead.

it's not a difficult one to solve:

let r: it has rained, c: it has been cold, d: the plant is dead.

x translates in FProp to:
(r /\ c) -> d
y translates to:
r -> (¬c \/ d)

truth table for x:

r c d r/\c (r/\c)->d
-----------------------------------------
T T T T T
T T F T F
T F T F T
T F F F T
F T T F T
F T F F T
F F T F T
F F F F T


truth table for y:

r ¬c d ¬c\/d r->(¬c\/d)
-----------------------------------------
T F T T T
T F F F F
T T T T T
T T F T T
F F T T T
F F F F T
F T T T T
F T F T T


the last rows are the same, so the two statements are equivalent; that is,
(r/\c)->d <=> r->(¬c\/d).

the reason this particular problem is useful is simple: it's "truthy", so to speak. most students will be able to "see" on some level that the two statements are logically equivalent; most will use a real-life workthrough of them to determine whether they're true, which is why meatspace analogies are so useful to (non-wired) students when teaching them something new. more on teaching the wired ones later.

(for those not sure what i'm talking about, wired refers to a person whose life is intimately connected with the world of machines and the Net, or sometimes a Net addict; meatspace is the opposite of cyberspace, and refers to the non-mechanical world.)

oh yeah - and Vista's native Mahjong is a fucking kickass timewaster.


Lepht

18.6.07

"holiday"

i really don't like this holiday fuckaround. everything in the whole of your average university shuts down, leaving people like me the only fuckers on campus - and in the case of yours truly, the only fucker on campus. it's bizarre - the cafes and shops close down, the labs are empty, professors and tutors stop checking their email, all the experiments you can usually earn a good few bob from stop running and you're left to sort shit on your own. i hate summer vacation.

this means two things: one, i can eat cornflakes in the lab, and two, i have a lot of time on my metal-filled little hands. (there's a half a cannula in my left hand where the NHS suck.) thus, i have time to show you cool shit like the contrapositive implication.

in propositional logic, the IMPLIES operator looks like this: -> . if P implies Q, the implication can only be false where P is true and Q is false. the contrapositive is the reverse and NOT of an implication; that is, where P->Q, the contrapositive is !Q->!P. interestingly, it always gives the same truth value as the original implication.

you can prove this with a truth table:

P Q P->Q Q->P !Q->!P
--------------------------------------
t t t t t
t f f t f
f t t f t
f f t t t

the rows for P->Q and !Q->!P are the same, so the contrapositive is the same as the implication. cool, huh? so the next time you see a nasty-looking thing like !Q->!P, you know you can simplify it to P->Q.

man, i really gotta get a hobby.

Lepht

10.6.07

the universal tautology conjecture

to begin with, i bring something interesting to the table. this concerns formal logic, one of the most simplistically beautiful things to learn in my field, and one of the most rewarding; i shall be happy to explain the basics of predicate, propositional and fuzzy logic to any member of the set of homo sapiens capable of looking at a negation and asking in all honesty, "What the fuck is this line thing for?", so please ask if it's necessary. logic is a tool everyone should have access to.

there are some statements which are always agreed to be true; these are tautologies, and there are an infinite number of them. for all P, (P \/ ¬P) - "either P is true, or not P is true" - is one; i'm not talking outside the realms of formal calculae here, so "There is too a God" and "Lepht is a narrow-minded bastard" are not.

by the same token, a contradiction is a statement which is always agreed to be false. for all P, (P /\ ¬P) is one of the simplest ones - that is, "both P and not P are true".

there's a problem with this, though. logic comes in different systems; the statements i've showed you are tautological or contradictory under propositional logic. if i quantified them, they would be so under predicate logic, too. but there are many logical systems.

the one that chucks the proverbial spanner in the mail sorting machine and giggles like a heathen in church as it all explodes in a fountain of shredded paper and jiffy-bag shrapnel, so to speak, is fuzzy logic. fuzzy's a new system, and it's all fucked up: the fundamental difference between it and the older systems is that truth, in the old ones, is a binary value.

this deserves further inspection. under a system with binary truth values, truth is one of two things: 0 or 1, T or F. any value P can be either true, or false; it can't be neither, and it can't be both.

fuzzy logic kicks that in the balls: under this new system, truth is a double. so P can have any truth value from 0 to 1: it can have one of 0.009, or 0.56, or 0.987. the biggest ramification of this is, then, that P can belong to the groups "true" and "false" at the same time: that's why it's called "fuzzy": it blurs the once-concrete lines of 0 and 1 into a strange continuum of half-truths and grey areas that can't be used in the same precise way.

enter the propositional tautology. analyse it again, and unfortunately it loses its status: under fuzzy logic, P and ¬P can both have a non-zero truth value, meaning superficially that neither one of them is false.

fuck.

this, friends, is my problem. it's my opinion that for any given tautology or contradiction, Q, a system of formal logic can be devised for which Q does not hold; that's my conjecture, the "universal tautology problem". i haven't tried it exhaustively, of course, but i'd like to write an algorithm that could; it would be non-halting, though, until it found a tautology or contradiction it couldn't invalidate, and so it probably wouldn't finish during my lifetime (in fact my research hypothesis for the experiment involvong such an algorithm would be that the machine eventually stops, the null being that it's a non-halter).

there are many more famous problems in logic (at some point i'll chew through Bertrand Russell's paradox of naive set theory, purely because it's so stunningly obvious post hoc and so easy to miss when you first encounter sets). it's the ability to dissect these kinds of problem that make homo sapiens sapiens so awesomely intelligent.

and i'm not talking about myself. let the first game of Correct Lepht begin: discuss, my friends, discuss!

Lepht