Sunday, April 21, 2013

Science Knowledge/Teaching

So this weekend I volunteered to judge a Chicago High School science fair/competition. The people participating were all mostly affluent it was enjoyable and an interesting experience. What I want to comment on is that state of scientific teaching that it appears these kids have had.

Science is not easy. Most Ph.D. scientists have been studying science for around 12 years before they even receive their Ph.D. There are so many people out there who think that science is easy. That one can just make up scientific theories in their spare time if they are "smart" enough. I don't really believe greatly in intelligence though. Just as in sports you have people with lots of natural talent, I am sure there are people that have lots of natural talent with their mind. However, that doesn't mean that someone who trains can't be at the same level or better. Someone who learns and thinks and takes care of their mind just like an athlete would their muscles and body. So what is scientist then? To start out being a scientist one needs to accumulate knowledge. That is the way it is for everything. Is there a chance that someone will be able to write down a random proof that proves P != NP or some such? (http://en.wikipedia.org/wiki/P_versus_NP_problem) Maaaaybbbee but in all likelihood that will never ever happen.

So back to the science fair. These kids know nothing about science. Instead what they are taught is that they should try and "Reject their Null hypothesis." It is sad. Scientists don't sit around trying to reject Null Hypotheses. People don't even mention a Null hypothesis in college besides perhaps a statistics course. The lack of scientific thought and knowledge was somewhat appalling. I am not saying it is this way all across Chicago or even all over the US but for an affluent Chicago competition I expected more. I volunteered with FIRST robotics for two years and it was quite impressive. The things kids can program these days and their computer knowledge and skill is advanced. We have only had personal computers for the past ~20 years and people have been doing molecular biology for the past 50.

Myself as an example. I started programming in High School on my own. Eventually by my senior year they had a C++ class for advanced students. Our biology labs however didn't even have a basic electrophoresis setup. Why? This makes no sense to me. Why are we not teaching younger people advanced science techniques or exposing them to advanced science it is the only way they will learn. Instead of having kids drop out of college to start the facebook. They will drop out to start their own biotech company. "Smart" takes time and it seems in science we are all starting a little further behind everyone else. We are not "allowed" to learn about real science until college. I think this is a big issue. I think science needs to be more accessible. Science knowledge needs to be more accessible.

I don't think this is something that can be easily fixed but requires many/all scientists to believe this is something we need.

There are 16 year olds programming video games and websites and robots and they don't even know what DNA is. I think that is a problem.


Friday, April 12, 2013

Transient Voltage Through Photoexcitation of Metals(Iron?) in Water. (Photoelectric effect?) (Photo-Fenton reaction?)

This sounds crazy I know. I thought it was crazy when I saw it but I have tested it so many times and have shown that it actually works.

I stumbled upon this while working with the light activated protein domain from Oat(Avena sativa) LOV2

You put metal electrodes in ordinary tap water  and you see photovoltages. This data is not so precise, I know but I ordered a multimeter I can attach to my computer a few days ago. So once I receive it I can have actual plottable data.

This is very similar to the Original battery except without salt and with light
http://en.wikipedia.org/wiki/Voltaic_pile

Basically what is happening in these electrochemical cells is Atoms are being oxidized in one electrode(anode) and reduced in the other(cathode). So electrons from the oxidized electrode flow to the reduced electrode.

So this is what I tried:
All were measured in 300uL of tap water in a polystyrene plate.
I took two pieces of metals and placed them in the liquid not touching, one higher than the other and connected a multimeter to each electrode.


Steel wire, Steel is an Iron alloy, so it is composed mostly of iron but has ~1.5% Manganese and 0.8% Silicon and other trace elements
(http://www.lincolnelectric.com/en-us/Consumables/Pages/product.aspx?product=Products_Consumable_MIGGMAWWires-SuperArc-SuperArcL-56(LincolnElectric) )

About 10-20mV from one electrode to the other in tap water. This voltage increases over time about 10 mV every 15 minutes. There is a transient photovoltaic action of about 10mV. Repeatable with delay. I think this is the photo-fenton reaction in which the light is photoexciting  Fe3+ to Fe2+.
(http://en.wikipedia.org/wiki/Photocatalysis) In the photofenton reaction light produces free radicals producing Fe2+ and OH radical. These radicals should react quickly. But why doesn't continuous light keep a stable voltage? Maybe it is something with my setup.
These transients last for about 1-2 seconds and then the voltage starts to return to the normal value even if there is still light in most cases. I don't quite understand the process.

Copper wire, which is composed from as far as I can tell mostly of copper. Maybe not? 
Pretty good acquired the highest voltages from this. >100mV on some occasions.
Stable around 80-100mV.
Electrodes wear out in about 30 minutes


Platinum Electrode
No voltage which was expected as platinum is pretty inert.

Steel and Copper

This is a steel cathode and copper anode.
>400mV and 5uA of current

Light effect transient stays with continuous light. A ~5-10mV decrease is observed after a few seconds of light exposure. However, there is an increase upon long-term light exposure. The voltage was around 500mV after about 5 minutes of light exposure! That's 50-100mV increase from light. crazy! also, upon removal of the light we don't lose much in terms of voltage maybe just a few mV.

~20mV per 10 minutes decrease in  voltage that is based solely on the copper. i.e. Switching out the copper brings the voltage back up.

In a solution of table salt(Sodium Chloride, Dextrose, Potassium Iodide, Calcium silicate)
The current increases to between 10-20uA.
I also see transient current increases in response to light.

This solution decreases what I assume is the destruction of one of the electrodes to about 5mV / 20 minutes, which means the electrode has a half-life of about 1 day if the destruction is mostly linear.

Steel and Aluminum Silicon
~40mV
There is a light effect but surprisingly unlike the other light effects this one takes a bit of time before it will work again. Usually when I shine light I see the transient and then it starts to decay and it decays in a few seconds. After it is decayed I shine again and it works to the same magnitude. In this one if I try the same the second time there is much less amplitude in the transient.

Steel and Aluminum foil
~200mV 1uA
I see a nice 10mV change upon light which is alot more stable than in all the other cases. Under continuous light I see a somewhat stable value. However, I think the aluminum is being rapidly oxidized from the increases in Fe2+ so the voltage starts to decay pretty fast. A very small change in the current upon photoillumination.

-------------
Using filters I narrowed down the light wavelength that causes the effect to somewhere between 300 and 450 nm.
It seems like this is some form of the photo Fenton reactionor maybe a Photoelectric effect. I don't know much about this type of photochemistry.
Iron can be photoexcited between those wavelengths.

I know this data is not that exciting at the moment but it was interesting to understand the properties of these metals and see crazy photochemistry. Even in just tap water. Who knew that you could generate voltage and current like this!

I need to scale it up and I want to build a light that works by using rain and the sun! Much cheaper than a solar panel! Can connect in series and it works great but low current. Which means I need a decent electrolyte.

Or what about a piezo-electric light that works by rain?

More studies on electrochemistry coming. I just need to learn more about it.


Friday, April 5, 2013

The Good About Science

I think often  people express all the bad about science.
I am guilty of it also. Lack of funding. Hard to find a job. Discrimination. All the politics. Hard to publish. Blah blah blah. But what about the good in science. We don't often hear people talking about that.

I love science, I love it. I mean if you read my blog you know this because I spend much of my free time doing weird and random science experiments or engineering or programming projects. The past few days I have been working on some really cool projects, building and developing DIY lab equipment, programming machine learning stuff, optimizing my 3D printer and other extra special projects I will write about soon. It is so much fun, it is so beautiful.

I love science and building stuff it is my heart and soul. I love learning and thinking and contemplating. These things challenge me in such a way that I constantly have motivation to learn more and try harder.

Problems. That is what inspires me. How do I solve this problem? How can I gain/provide more insight on this topic? I constantly think about these things.

Ideas. That is what inspires me. Nothing makes me more excited than a new idea that is complicated enough to challenge me and requires me to learn and gain new skills or combine skills in a new way in order to bring the idea to reality.

Some people do science or do engineering. It is different for me. I am a scientist and an engineer. Someone once asked me what I would do if I was last person left on Earth and I said "I would go to work and do research and it would be nice because no one else would be around." Now I am developing my own personal lab/work space at home so I guess I could just stay home and work. 

I am not one of those people who can sit around and do nothing all day or watch TV. I have so many things I want to study or work on or accomplish or fix or develop or discover.

Science shows me the beautiful parts of the world. It allows my life to be exciting without even leaving my chair. Science and engineering and knowledge have given me the ability to discover amazing things and see beauty without traveling to far away places.

Yeah it has been hard work and yeah it sucks sometimes but I won't give it up, I can't give it up.

Thursday, April 4, 2013

Machine Learning and Perl

----EDIT TO POST----
To the people who find this post by an internet search I suggest you give up on machine learning in Perl and learn to do it in Python. That's what I did.
---------------------------

Yep, that's correct. I started to do some basic machine learning programming in Perl.

See I had this large dataset that I generated and wanted to understand it better. We were working with someone who was using RandomForest modeling and I wanted to have a better grasp of that so I decided to program a Decision Tree learning program to take a general dataset and map it to a binary effect. I chose a binary effect because non-binary effects are much harder to do especially on a small dataset like mine with ~75 values.

Basically what the program I wrote does is take the whole dataset and calculate binomial probabilities for a given feature value to predict the outcome. This has led me down many streams of inquiry.

How to bin features?
Been thinking of using k-means clustering.

How/If to calculate feature entropy?
I have been having trouble with Information Gain Entropy because some features I use have lots of possible values. Information gain entropy biases to features with fewer values. I could iterate over all possible mutual information values but that could possibly become very problematic with datasets with many features. But probably not.

Is it possible to generalize machine learning?
Kind of but not really. There are so many caveats with every machine learning technique. It cracks me up. I will spend time thinking about about why something shouldn't work only to read about it and find out that it shouldn't work or that there is a bias in the method.


So I wrote a basic machine learning program in Perl that takes binary effects and tries to predict them using the features and states of features that you give it. I used it for trying to find any information as to how or why mutations I made to a protein did what they did. It didn't tell me much besides the fact that many characteristics of each residue determine it's effect on function. Surprisingly BLOSUM62 scores are a really good measure of the effect of a mutation on a proteins function.

The code is a total kludge but I like Perl because of hashes. You can put anything in a hash and do anything with a hash. Very nice. However, the way Perl handles array values vs array references is not very nice.

The code will take a training set of data and find the best predictors for your binary effect it will then attempt to predict data in your prediction set. It will compare the top 3 best predictors for each datapoint to come up with a prediction. It will tell you how often you predicted correctly. Mutual information code is in there but it doesn't use it because my data doesn't have enough points to make mutual information useful.


Decision Tree Code


0-6 on Post Doc emails (1 response)
I think I will blame it on sequestration.


Tuesday, April 2, 2013

Solidoodle 3 Review! My first 3D printer.

Yep, that's correct I purchased a 3D printer. The Solidoodle 3.
I was in the market for a 3D printer because I had saved up a little bit of money and wanted one that was built and tested and under $1000 and I knew I would receive it in less than 2 months or so. I was thinking about the Robo3D they had a kickstarter campaign and were priced about $650 but they really failed to post any videos of a finished product and the quality of the prints. I decided on the Solidoodle 3 which had a delivery time of 6-8 weeks at the time, it has since changed to 8-10 weeks. I will be honest, their customer service is shit. I purchased the printer at $799 and a few spools of ABS filament and the total came out to about ~$950 with shipping. I received one email from them when I purchased it and that went to my spam folder so I didn't even notice it till after I emailed them asking what was going on. Then I received an email that it shipped 7 weeks later. I emailed them in the interim, actually a few days before it shipped to ask on the status and the person who emailed me back said, "Delivery time is 8-10 weeks." If they can't/don't even check to see when a customers item will be shipped that just spent almost $1000, that is pretty shitty. On top of that. The printer came with no instructions. Their website makes really no mention of using Linux and Solidoodle 3 besides to install some software that they don't even provide updated config files or parameters for. Actually, I couldn't make it work initially and posted on the Solidoodle Google Group asking about it. After, I figured out how to make it work and posted what I did someone form the company asked me for the config file I used! haha. Seriously? You don't even know how to make your own printers work?

3D printers are not ready for the average non-technically inclined person to use. I imagine most other printers in a similar price range are the same way. From what I see and read it appears that printers in the $2000+ price category are somewhat more beginner friendly and non-technical.
Technically documentation is extremely lacking and up-to-date tutorials and guides are also. The Solidoodle is decent piece of hardware but it needs so much more to make it even remotely a good investment.

As for printing.
Nothing sticks to the bed unless it is huge. That is a problem because huge things tend not to print well due to lack of temperature control and the bed only heating to ~80C when they say on their website that it should go to >100C. They admitted on Solidoodle Google Group that they were just too lazy to change this on the website. 

Well I am sure I will have much fun with this thing printing off stuff for my projects. However, I don't think 3D printing is ready for the general public commercial market just yet unless one is willing to pay > $2000.

My first successful print. Pint glass for scale obviously.
 

I have created a Beginner's Tutorial if you have a Solidoodle 3 and it can be found here:
http://doitourselfscience.blogspot.com/2013/07/solidoodle-3-beginners-tutorial.html

Monday, April 1, 2013

Whoa

So many cool things I have been working on lately. I have been spending so much time doing experiments and learning and coding that my writing has not been catching up. Hopefully I will have some free time this week when I am not obsessively thinking and working on a project.

Still no Post Doc. A few people have offered me jobs here at the University of Chicago. One of my Professor friends Tao Pan is top of the list. We will see. I just don't see why/how people don't reply. I mean seriously. It is very weird how these people treat other human beings when not long ago they were in the same position. Weird. I wish I could vent more about it but I guess I don't really care enough to. Too many cool things I am working on.

Been testing my memory every morning without fail. It is very difficult to try and figure out memory techniques. I can't tell if my memory is improving much. Strangely (why do adverbs seem so weird?), I can remember 10 digits by looking at them for less than 5 seconds by chunking them into 3s and a single (111 111 111 1). But 11 numbers is significantly more difficult for my mind. I have been trying to figure out a simple way to overcome this without resorting to extension mnemonic devices. Difficult for the time being.

I have drastically reduced my drinking and my mind has been working better than it has for the past 5 years. I don't even have enough time and energy to keep up with all the ideas and learning I want to do.

Hopefully, new fun experiments/ideas will be posted soon.





Sunday, March 24, 2013

Intelligence and Creativity and Memory

What defines intelligence? or creativity or memory? Is there a way that we can increase our own? How much effort should one invest in bettering their intelligence and creativity as opposed to just using it?

I think about these things often. Having an interesting idea and implementing it is really fun and exciting. Both can be difficult. Ideas are only as good as ones ability to implement them and if you cannot have ideas it doesn't matter how great you are at implementing them.

I have been trying to track when I have my most interesting ideas. It seems that they occur when I am dramatically exposed to a large amount of new stimuli or when I have time to think. I have been having trouble with exposing myself to new stimuli. This is a hard task. Where does one look? I try and read science journals that are out of my field but I am having trouble with this. As for the time to think I have a reminder on my Google Calendar to take 5 minutes a day and try and think of something new. I take 5 minutes and relax and close my eyes and listen to Zoe. It works ok but I think I definitely need the fresh stimuli.

Is there a better way to think? Is the way I think in general about things inferior to a possible different way of thinking? This is really hard to quantify. I often try to modify my thought patterns to be more productive. I have tried to teach myself(very little effort) to be able to hold two things in my mind at one time(There should be an old blog post on that here) . I probably should put more effort into that. Thinking is a very abstract idea. Sometimes my brain is so good at processing complex thoughts and my memory works very well, other times it does not. How do I make things function optimally all the time? Difficult to figure out. I have started drinking alcohol much less. Hmmm but I don't really have many more ideas?

One thing that I can quantify that is related to intelligence and creativity is memory. I have been listening to the audiobook Moonwalking with Einstein. I do prefer paper books but I recently found out I had an audible.com account active for a year so I have lots of credits to use... Anyways, as most things do it has inspired me more to better my memory. For the past year or so I have used Memory Trainer an android app. It has taught me interesting things about my memory and has also improved my memory to where I can non-mnemonically memorize sequences of numbers up to around 10 digits fairly easy by chunking. It is free and probably just as fun as Angry Birds or some such game though I have never played Angry Birds so I might not be the correct person to ask. I think by learning some mnemonic memory techniques I can create an overall better memory for the rest of my life.

I decided I would take 5 minutes or so everyday and practice memorizing strings of numbers. I wrote a small program in Perl to allow me to test myself (http://pastebin.com/nyJWs0e3).

I really want to be able to think the best I possibly can. Nothing makes me more excited than having an interesting idea and executing it as you can probably see by my blog. I think the complexity and originality of the idea are what make me excited. These two things require my best creativity, my best ability to generate new ideas and my best brain function to think about complex things. I wish these came easy to me. I think I need to take more time and just relax and think and calm down and experience. Think. Creative. Execute.

If only I was smarter.


And after just sitting and staring off into space for no reason I just had a fun idea!
Do people make more spelling mistakes when they are happy or when they are sad and can we figure this out using twitter?

Thursday, March 21, 2013

Book Recommendations from Vincent Van Gogh

So I read alot. A real lot. Mostly when I have time to burn and I am sitting around at home. Sometimes only 5 minutes sometimes an hour. Most of the books or authors I enjoy I have read. Also, many of the books of that have been written by similar authors. I have come to place were it has become difficult to find a good book recommendation and I resort to choosing random books. Almost.

I have been reading Dear Theo an abridged version of Vincent Van Gogh's letters to his brother Theo. Here is an unabridged version free to read ! Which is crazy. Now I think I will start reading that instead. Though I do love holding a book. Anyways, through these letters I have felt as if I am in conversation with him. He even mentions the books he enjoys reading including Les Miserables... but also Fritz Reuter's My Time in Prison (
Ut mine Festungstid) but unfortunately I cannot find it in English. The humorous thing is that this is not the first time I have taken book recommendations from someone dead. Maybe this is the best way to go about it?

I tried the GoodReads website but it recommended me some awful books. I think it is because of the seemingly random genre's I read. I like John Steinbeck and Sci-fi and Non-Fiction and I also read a Nicholas Sparks book once. I never read Harry Potter or Twilight though. That is based on moral grounds. Well not really. I just have no interest.

I have been studying alot about prediction lately and using machine learning. What I have found is that the reason that some predictions are not good is the lack of data. For instance. If I say I want to predict how many 20-30 year olds will buy a dress in the next year. The first feature you should want is sex, male or female. Just having that one feature changes my prediction capacity drastically.

Anyways, I will write a post up soon about predictions. I need a book recommendation now.

Also, still no luck on Post Docs. 0-3 at the moment but I hear some of my colleagues are 0-20. YIKES!

Monday, March 18, 2013

How Many Proteins Are Actually In There

Sooo, people simulate proteins using Molecular Dynamics. Basically, you are sticking a single virtual protein molecule in a virtual box of H2O molecules and calculating newtons laws of motion to watch what happens.

When you work with proteins experimentally you can rarely see them unless the concentration is really really high or the protein aggregates. Doing certain Biophyiscal measurements, I know the concentration of the protein because I can calculate it based on light absorbance at specific wavelengths but I never had an intuition for what this meant. Normally experimental concentrations range from 1 micromolar to ~5 millimolar and only 5 millimolar if you have a super stable non-aggregating protein.

So how do I compare a single protein in simulation in a 100nm^3 water box to the proteins I work with in a cuvette or NMR tube?

Ok so let's say that the protein is 4kDa so it's weight in grams would be
 (4000/6.022E23) = ~6.6E-21g
 We just divide it's Mass by Avagadro's number since kiloDalton's are an Atomic Mass Unit.

How big is 100nm^3.

1nm^3 is equal to 1E-24 L. WOW!
An MD simulation is ~100nm^3 so we have 1E-22 L.

How many molecules would 1mM be in 100nm^3?

((4000 g * 1 mM) * 1E-22 L) / 6.6E-21 g per one protein = 0.06 molecules


That is not even one molecule!


16.5mM is ~1 molecule.
100mM is ~6 molecules and 165mM is ~10 molecules

So the effective concentration of a small protein in an MD simulation is much much higher then one could ever measure or use in real life. 

I know this is super lame but I liked it.

Sunday, March 10, 2013

Making money by buying stuff on eBay

Yea, yeah, yeah. I know. This sounds like an infomercial but I swear I am not selling anything. All I am telling about is a way I found to make some extra money on eBay. Yeah, it actually works and in some cases I have made over 100% of the purchase price.

So how does it work? Well eBay is based on people searching for specific items. When you try and buy something on eBay you go and type in "rock climbing shoes" or if you are trying to be more specific "5.10 anasazi" or some such. From looking at eBay it seems that the majority of things being sold on eBay are not from you or I or Joey joe joe, they are from companies that buy up large piles of shit for nothing and then sell it all on eBay. This is great because most of the time they don't know what they are selling. If you do know what they are selling and they are selling it for much below the price that it is worth then you make money.

Ok let's have an example. I am scientist and know alot about equipment in the field of molecular biology, biochemistry, biophysics. I can identify things on sight.

http://www.ebay.com/itm/MJ-Research-PTC-100-Programmable-Thermal-Controller-O-/150978530885?pt=LH_DefaultDomain_0&hash=item2327058e45

If you are a are a molecular biologist you know what this is. It is not a programmable thermal controller. Well that is the name on the device but it is actually colloquially called a Thermal cycler or a PCR machine. Maybe you got the picture already. When things are mislabeled in the title people can't find them with a search so many times they are not bid on or go for really cheap. What one can then do is look up the colloquial name of the product and see how much they usually sell for. If the price + shipping is less than the price you would sell it for +  seller fees + $20 or so then buy it. When it is resold you can always reuse the box and increase your shipping price a little to make even more money. All you are doing is changing the title of the item.

The hard part is finding the miss-used names. That just takes some grunt work of browsing eBay. Just go into the Healthcare, Lab and Life Sciences category on eBay and just browse. That thermal controller one was a good one. Also, people call stir plates "mixers" or "stirrers". People call variacs,  autotransformers. Lots of things like that.

I ended up making about $1000 over 6 months or so. I sold about 30 items with a mode of about $30 some more, some less. Some I lost a little on. This was all before I wrote the tool below instead I would browse and browse.

I think the problem with this business model is throughput. You need to be able to receive and ship packages. Test stuff. Deal with peoples issues. You only have a certain amount of time each day and these things can take time. It is really easy to make $1-5 on eBay but unless the scale is huge you are just wasting your time. I felt like I needed to make around $30 per purchase or I was just wasting my time.

Here is code I wrote to quickly and easily parse eBay for selling prices and prices of stuff that has already been sold Click here for eBay tool.

Things to remember:
1. Sometimes it takes time to sell stuff, a month or more
2. Don't forget seller fees from eBay and paypal they usually amount to about 10-20%
3. Always pay for delivery confirmation when shipping things it is usually less than $1 or $2 and saves you the headache of a customer saying somethign was lost in the mail.
4. Be wary of items that are being sold "AS-IS" especially if testing the device is as simple as turning it on
5. Find keywords in the titles of sold items that correlate with price
6. Buy bulk if you can, some of the most money I made was by winning an auction is which someone was selling alot of something. Such as 5 stir plates or 30 lasers.
7. Sell things as working but no returns or AS-IS working, guaranteed non-Dead on Arrival. You don't know the long-term survival of the item and giving refunds to everything that breaks is just not reasonable.
8. The investment is not great, starting out with $200 is usually good to buy a few items.


Thursday, March 7, 2013

Guessing

Is there a way to guess better than random chance? I was thinking about this alot. And wrote a program that simulated this and the results were crazy which sent me on a crazy knowledge spree till I figured out that I rediscovered the Binomial Distribution. HAH.

Here is the dilemma. Say you are playing a game that you guess a number between 1 and 10 and a computer guesses and number between 1 and 10.

These outcomes being either a yes, you win when you both guess the same number, or a no you don't, when you don't.
You are trying to win the most. And you know the probability of these outcomes beforehand. Can I have a better win percentage than guessing 1 every single time (~10%). Our apparent probability for randomly guessing is equal to 1/N . Where N is the number of possible outcomes.


Problem...
How can I win 10% of the time if I only play a game 9 times. Since winning is an integer. This means my winning percentage for playing 9 Games in a Contest with a 10% win rate is either > 10% or 0.

So the probability that we are above the 10% between 0-9 is much much greater because of the integer rule(I have no idea what this is actually called I just made up a name). The probability increases up to 9 or 19 or 29 &c. Once we hit a number divisible by our probability of success we immediately drop because we can now have an integer higher number of successes.

Let's simulate this.


Trials Probability of > 10% Success
1 0.1
2 0.19
3 0.27
4 0.35
5 0.41
6 0.47
7 0.52
8 0.57
9 0.6
10 0.26


See once we hit 10 our Probability of having greater than 10% success drops because we now need more than 1 success! We can only have an integer number of successes remember! CRAZY!

This is interesting.

Further, we have a binomial distribution.

If we look at a binomial distribution for p=10% and 20 Games/trials which we have from wikipedia!

The x axis is our number of successes and y axis is the probability of x number of successes. Were the blue is 10% chance of success on each attempt, the green is 50% chance and red is 80% chance. Our actual chances of having >= 2 successes in 20 games for a 10% or greater success rate is much greater than 10%! Whoaaaa. Mind blown. Sounds, made-up I know. But let's simulate this and prove it. If we calculate the Binomial Distribution for Chance of success or p = 10%. Here is the Perl code . What what!!! It totally works exactly how the binomial distribution suggests! WHOA!

Here is the calculated Binomial Distribution:

Successes 20 Attempts 30 Attempts
1 0.27017034 0.14130386
2 0.28517981 0.22765622
3 0.19011987 0.23608793
4 0.08977883 0.17706595
5 0.03192136 0.10230477
6 0.00886704 0.04736332
7 0.00197045 0.01804317
8 0.00035578 0.00576379

So the code will calculate how often we break the 10% expected barrier. So for 20 attempts that would be the Sum of 3-8 and for 30 it would be the sum of 4-8. Our simulation results are almost exact! MATH! SCIENCE!

For having greater than 10% success (>2 for 20) the sum for 20 is 32% and with 10000 simulations we have an astounding 32.37%!!! For 30 trials calculated from the Binomial Distribution is 35% and we have 34.93% from the simulation!!

What this says is that we actually have a > 30% chance to beat the odds in a Binomial Trial that one only has a 1/10 chance of success!

My mind is blown. This is true for all replacement Binomials.

So this is what you do. Play the number guessing game with your friend. You both choose a number between 1 and 10 and if you guess the number they guess, you win. Now bet them that you can guess correct greater than 10% of the time. Now play the game 9 times and you have a greater than ~60% chance of winning the bet.

MINDBLOWN!


So if you are playing a Binomial game your best chance of success is by playing (1/Probability of Success) -1 games!














Sunday, February 24, 2013

Electronics for Ourself: Attempt One: Astable Multivibrator

I just realized that even though I do electronics I am not an engineer. I remember when I first started programming. I could copy others code and change small stuff(like I can with Python) but when I started to delve into a learn how exactly everything work I could read code and write masterpieces. This took lots of study and reading and practice. I want to attempt to learn electronics like I did coding, I think it opens up so many creative avenues for myself.

Electronics experiment for the day(this post took me like a week haha) the astable multivibrator. Or Try and Blink LEDs

The Astable Multivibrator circuit was more complicated then it looks at least to me, needing to teach myself all the basic electronics I really don't know. An astable multivibrator does basically what it says, it vibrates a current by switching/oscillating between two transistors using two capacitors. It is called 'Astable' because the circuit is not stable in either state or oscillates between states.

Basically all that it is composed of is:

2x NPN transistors
4x Resistors
2x Capacitors
We will add LEDs because I am assuming you might not have an oscilloscope (I don't yet).
2x LED

First we need to figure out transistors. So an NPN transistor  has two terminals termed the collector (the lead the light is connected to in the picture) and the emitter(the lead with the arrow in the picture), and a base. When one applies a small voltage or current to the base it allows a voltage to run from the emitter to the collector. I stole this picture from wikipedia but it is a good example:

What we see is that the transistor is connected to both the positive voltage and the ground. We would expect a voltage to flow through it but it doesn't because the transistor is separated into 2 distinct regions an N (electron negative) region a P (hole or positive) region. An NPN transistor has two N regions separated by a P region. and a PNP transistor has two P regions separated by an N region. So in the N we have electrons which we want to flow in a certain direction, the bias of the transistor. In the NPN the electrons are separated by the hole. So let us think that when we are applying a voltage to the base we are causing the holes to pair with electrons in the P. Once we apply enough current enough holes are paired to bridge the Ns that we see electrons from the positive N flow to the ground N because electrons want to move in the direction of the current. A PNP transistor works the same way except with holes instead of electrons.

It took me a fair bit of time to find a good explaination(not a misspelling) of how the holes and electrons move and even those were poor so don't fault me too much!

So on to the Astable multivibrator. Again picture from wikipedia.

In an astable multivibrator we have two capacitors that are charged and subsequently discharged causing the voltage to oscillate between two different paths. So how does this work? So in this diagram we will assume R1 and R4 are low value resistors(1K ohm) and R2 and R3 are high value resistors(10K ohm, higher than R1 and R4 I mean). Once we turn on the circuit the Voltage is looking for a way to get from V+ to 0V. We have 4 resistors is parallel which means that the flow of electrons is going to try and traverse through all of them.  So what happens is that initially one of the NPN transistors let's say Q1, receives electricity to it's base slightly faster than Q2. When this happens electricity can flow through capacitor C1 because the Collector-Emitter(left and right nodes) bridge on Q1 is opened up. So initially C1 has no charge and this keeps Q2 off. But based on the value of R2 it starts to build up charge and once the voltage on the left lead of C1 reaches the activation voltage of Q2, Q2 switches on. Due to the initial low value of the left lead of C2, Q1 switches off and then it happens again. C2 charges until the left lead hits the activation voltage of Q1. This is a pretty complex little circuit and I know alot more is going on then in my simple explaination but I am glad I grasped at least this much.

Now if we put an LED between R1 and V+ and R4 and V+ whenever either transistor, Q1 or Q2 switches on so will the LED! The frequency of the oscillation is ~ 1/0.7*(R2*C1 + R3*C2) . The 0.7 is juts a constant from the derivation.
I used:
R1 and R4: 1K ohm
R2 and R3: 10K ohm
Transistors: 2N2222a
Capacitors: 10uF

So we are oscillating at about 7 hertz.

Wheew. Hopefully attempt two goes faster but I learned a shit ton about transistors and capacitors writing this post!

YAY for LEARNING!

Saturday, February 23, 2013

Paper and Acclaim

We resubmitted the paper the Nature Structural and Molecular Biology. Not necessarily because we have such high aspirations for it but because this paper is in no rush to be published so why not? I always have weird feelings about publishing. How much should I care to publish and how much should I care to publish in a good journal? How much should I care whether I am first author or if my name is not even listed? Obviously for things such as graduating from a Ph.D. program you need "proof" that you did scholarly work. In the end how much does any of it matter though. My goal is to do science. I enjoy science. I enjoy figuring things out and theorizing. I don't need people telling me how great my work is or how poor it is. Generally, I am self aware about the science I do and I know the quality level of it. This is not to say that it is _not_ good to have the input of others. It is good. I think science needs discussion and collaboration.

An interesting example is this: I have met two types of scientists, those who share their unpublished data without a second thought and those who guard it like it is the most precious possession in the universe. Why do people guard their data? To prevent being scooped? Their is too much pretend competition in science. Or competition at all. Science is not a competition against each other. It is a competition against the universe. The competition is, how much more of that angry bitch can we help the world understand before we die. Sure, it sucks to see someone else take credit for something you did. Credit should belong to who credit is due but why do we need credit.

This question has always bothered me and I guess it is centered on human emotional need. As human beings we want to feel wanted or needed or worthwhile. It is strange that we as humans have not evolved a system for inner self-worth without the need for external stimuli. Maybe it is because we feel people who have more acclaim are more happy. Only one person in the history of the Nobel Prize has refused it based on not wishing the acclaim, Jean-Paul Sartre. One would think that since 1901 with over 5 prizes being awarded per year there would be a handful of people who would just refuse it because they think it is silly and pompous. There have been 826 Nobel Laureates to date.

I hope if there ever came a day in which people wanted to award me a prize for something I didn't request or need (such as fellowship or scholarship or grant, those are usually need based). That I would have the decency to turn it down because I am but a cog in the almighty machine of information and knowledge.

In the end however we are all only human. We all just want love and acclaim. Well most of us. maybe. Are we lying if we say we don't?



More science posts coming I swear. I have been really working on some for a fair bit of time because I lack the intelligence to completely explain the topics thoroughly. I am however, learning.