Float like a butterfly; sting like a bee.
Neuroscience

Float like a butterfly; sting like a bee.


Your hands can't hit what your eyes can't see.

For this reason, we have to be careful when feeding numbers into our computer. Check out what happens when you ask a basic math question to Python:

Pictured: the folly of man

Huh, that's strange. Where did all those zeros come from? It turns out that machines use binary to represent integers. This means that, for the number .13, instead of summing 0/1 + 1/10 + 3/100,  the computer must use 0/2 + 0/4 + 1/8 + ... whatever else comes after that in binary code. (Python calls this a float.) Make sure you keep this in mind when working with mathematically intensive projects.

Pi is an oddity. It's never-ending just like our efforts to calculate it. At the same time, it's always nice to appreciate how there are so many different ways to calculate pi. For example, you could drop needles. And, sure, we can always measure the ratio of the circumference of a circle to its diameter, but how do we tell a computer, a fundamentally deterministic and causal entity, how to calculate pi? Let's ask two different programming languages and see what they have to say.

Python:
pi=4*np.arctan2(1,1)

Fortran:
double precision pi
pi=4.d0*datan(1.d0)

(Notice the "d" in the Fortran statement. That tells us the double precision, or, to what power of ten we multiple our number.)

It appears Python and Fortran are in consensus about this one. If you use a bit of intuition when reading the two statements, you might be able to tell that they are both defining pi as four times the angle created from arctan 1. But what value of pi do they both actually give us?

Python: 3.1415926535897931
Fortran: 3.1415926535897931

According to Value of Pi, pi is 3.1415926535897932384...with several different computational techniques. Looks like it's a tie for this round.

I've found that working with two different languages on the same project forces you to really understand the syntax and meaning behind each of the languages. With my example of Fortran and Python, We can really see the difference between the two.




- Dna Pac-man: A Biological Twist On The Lsd Hunter
waka wakaMy friends and I have been working on a python-based version of Pac-Man in which RNA bases are eaten and transcribed into amino acids. Check it out!...

- The Importance Of Hashing
People who are just beginning to code make a lot of mistakes and do a lot of stupid things. I once used to struggle with parsing thorough every line of a file before I learned that it would be much easier to use split-functions and similar lists. One...

- Getting Work Done
It is not enough to be industrious; so are the ants. What are you industrious about? - Henry David Thoreau My new scorecard I crawled out of bed on a warm, brisk Monday morning, waiting for my energy to kick in and let me go out for a run before work...

- Developmental Social Cognitive Neuroscience (dscn) Research Assistant Positions!
Research Assistant Positions Developmental Social Cognitive Neuroscience (DSCN) Lab The Developmental Social Cognitive Neuroscience (DSCN) Lab (directed by Dr. Elizabeth Redcay) is looking for bright, detail-oriented undergraduate students to assist...

- Recent Or Up And Coming Grad? Consider A Research Assistant Career With Mathematica Policy Research!
Mathematica Policy Research, Inc. (MPR) is a nationally recognized firm that conducts domestic social policy research on health care, welfare, education, labor, and other related topics.   Position Title: Research Assistant/Programmers Location:...



Neuroscience








.