Creative Communications

22 June, 2010

Brain Training, Data Capture and Simple Math Problems

Filed under: Life Management — admin @ 10:00 pm

Personal Data Monitoring has been eeking into the public sphere of awareness. The basic idea is that if you can quantify information about your life, and adjust your input parameters, you can discover correlations you would otherwise miss, due to the frailty of subjective memory.

Brain Training is another facet which you’ve probably heard of incorporated in video games like “Brain Age“. We build our neural connections through use, hence the more you exercise your brain, the better it gets, according to the ideas of brain training.

Somewhere in my reading about this, I heard about someone who wrote a small program to test their math skills every day. They discovered a correlation between flax seed oil and higher cognitive performance. Wow! Yet, a casual google search turned up nothing so far as software.

I’ve been meaning to pick up a little Python, and here is my attempt to duplicate this program. Basically it asks you 30 simple math questions, times you and displays your score.

#!/usr/bin/env python
# encoding: utf-8
- inspired by some brain training / data measurement
Created by Sean Canton on 2010-06-22.
Copyright (c) 2010 All rights reserved.

import sys
import os
import math
import random
import time


timetally = 0
correct = 0
wrong = 0

for i in range(0, NUM_TRIALS):
start = time.time()
a = random.randint(0,10)
b = random.randint(0,10)
op = random.randint(0,2)
d = {0:"+", 1:"-", 2:"*"}
op = d.get(op)
s = str(a) + op + str(b)
a = raw_input(s + " = ")
#print 'Code: ' + str(s)
# print 'Ans: ' + str(eval(s))
# print 'Yours: ' + str(a)
finish = math.floor((time.time() - start)*100)/100
timetally += finish

if a == str(eval(s)):
#print 'true'
#print finish
correct += 1
elif a != str(eval(s)):
#print 'false'
wrong += 1
#print finish

perc = correct/float(NUM_TRIALS)

perc *= 100
print "time: " + str(timetally)
print "right : " + str(correct)
print "wrong :" + str(wrong)
print "% : " + str(perc)

As you can see, it’s fairly straightforward. .get is a dictionary method that returns the value from the key value pairs in variable d. Python doesn’t have a switch/case function, and I have to say, the dictionary way of doing things is much cleaner.

I’m looking forward to diving into more Python experiments. I’ll keep you all posted.

24 June, 2008

Underemployed, or Do employees dream of contracting?

You spend the first six months at a job learning your place, testing your limits and generally meeting what is expected from you. After that, the work-expectation set point has been established, and you have nothing to anticipate besides advancement, quitting or getting fired in a blazing row. There is no challenge, and you go to work not watching the clock, but looking for ways to pass the time. (more…)

30 May, 2008

How to maintain your Self-Esteem at work

“I don’t want to go to work today”

Do you recognize who said this? You and I, full of this stuff called ‘free-will’, give in to the incessant demands of our jobs simply because they hold over our heads the very stuff of survival, a steady paycheck.

As if constantly wrenching our individual will-power in order to be subservient to another isn’t bad enough, once we are in our work environment we encounter no small number of things which are detrimental to our physical and mental health. (more…)

Older Posts »

Powered by WordPress