Friday, January 10, 2014

Childhood Theme Songs

Goofed around pretty much all day; the post below is pretty much all I have to show for it.

Today I looked up all the theme songs of childhood TV shows that I used to like. I lived in France from 6-8 and so the theme songs from that time are of course in French.


Bioman



Bioman show was really popular when I was young. By my recollection, it was basically just Mighty Morphing Power Rangers done on a lower budget (is such a thing possible?). I thought the show itself was pretty stupid, but this is basically what we would spend our time playing as when we were kids. It was dubbed into French, all the actors were Asian (I assume Japanese). It had something to do with fighting a mad scientist and gengineered humans who could each summon a portion of a fighting robot. The video above isn't actually the opening theme, but it is the one that every kid associated with Bioman. The actual opener wasn't all that great.

Le Chevalier du Zodiac



This show was a phenomena in France. Every boy I knew owned at least a few of the figures from this series. If you accidently broke a piece on the intricate and fragile toy figure, there was going to be waterworks that day. Young boys just flat out loved this series. It was an obsession among my age group. I have vague recollections of the characters fighting older men a lot of the time. By my memory, they just permuted on fight after fight after fight. Again, I don't think this was the actual opener (it is too long) but it is the one I remember from my memory. Also, interestingly enough, it is the same guy who sings the Bioman song. I don't know what is up with that. All I know is that every boy could sing this song.

Ken Le Survivant de la Terre l'enfer



In my memory, he was "The survivor of Earth", but it turns out he survived Hell. Funny how memory works. This was probably the most violent show I would watch as a child. Ken was pretty hardcore, he would get jacked up and stick his fingers into people somehow killing them with (Tai Chi?) pressure points. He also was very fond of making "ka-ka-ka-ka-ka-ka" noises whenever he rapid fire punched/kicked/whatever. Naturally, whenever any group of boys play fought, we always had to make the noises Ken made when he fought. It must have sounded like a group of birds dying.

Galaxy Express 999



I have no real memory of Galaxy Express 999 being very popular. I am pretty sure that it was an older series. I don't think that any of my friends were into it that much. I liked it a good deal, as it involved lots of robots and a woman that a young boy is basically in love with. I am not entirely sure, but I think the woman may have looked like a physical education teacher whom I fancied. Anyway, the theme was straight up metal. Whenever I try to remember how numbers work in French, I always humm "Galaxy Express neuf san quatre vingt dix neuve" (9*100 "neuf-san" + 4*20 "quatre-vingt" + "dix" 10 "neuve" 9). Not that it comes up that often, but there it is.

Saturday, January 4, 2014

Basic Properties of Numbers (Ch 1)



If \(a\), \(b\), and \(c\) are any numbers, then $$a + (b + c)
= (a + b) + c. $$



Using P1, you can derive the same rules for all higher cardinality
sums of numbers. Here are all the expansions of cardinality 4:

$$((a + b) + c) + d =\\
(a + (b + c)) + d =\\
a + ((b + c) + d) =\\
a + (b + (c + d)) =\\
(a + b) + (c + d)$$


The most important thing to take from the above is that we can
reapply this procedure to show that any cardinality of sums can be
substituted down to property \(a + (b + c) = (a + b) + c\). For
instance the 4 cardinality sum of \((d + (e + f) + g)\) is really
just \(d = a\), \((e + f) = b\) and \(g = c\).


For any cardinality-N of sums, it would seem to rely on
having the cardinality-(N-1) of sums defined in order to have a
pattern that you can substitute into?




What is this grouping thing (the parentheses)? How do I
know that I can freely add and remove parentheses around numbers?
Where was grouping defined?




Why is it that grouping only makes sense at cardinality 3
and greater sums?





If \(a\) is any number, then $$ a + 0 = 0 + a = a. $$





For every number \(a\), there is a number \(-a\) such that
$$a + (-a) = (-a) + a = 0. $$


It is then stated that if \(a + x = a\), then \(x = 0\). The proof,


$$
a + x = a\\
(-a) + (a + x) = (-a) + a;\\
(-a) + (a + x) = 0;\\
((-a) + a) + x = 0;\\
0 + x = 0;\\
x = 0.
$$



I would like to be able to have some sort of mouseover for
each line of the proof. So that I could mouseover a line and it
would give me a little message like "P2 was applied" or "(-a) was
added to both side". How to do that?



I would like to have all the equals signs aligned vertically
in the above proof. How do I say that with Latex?






If \(a\) and \(b\) are any numbers, then
$$ a + b = b + a. $$





If \(a\), \(b\), and \(c\) are any numbers, then
$$ a \cdot (b \cdot c) = (a \cdot b) \cdot c.$$





If \(a\) is any number, then
$$ a \cdot 1 = 1 \cdot a = a\\
Moreover; 1 \neq 0$$



I do not understand why I do need to specify \(Moreover; 1 \neq 0\)
for multiplication, but I do not specify that \(Moreover; 0 \neq 1\)
in P2? What if P2 was a system that only had one number, namely 1?





For every number \(a \neq 0\), there is \(a\) number \(a^{-1}\)
such that
$$a \cdot a^{-1} = a^{-1} \cdot a = 1.$$





If \(a\) and \(b\) are any numbers, then
$$ a \cdot b = b \cdot a $$


There are several interesting things to note here:

  1. \(0 \cdot 0^{-1} = 1\) is undefined!

    because of the \(a \neq 0\) in P7.

    It is interesting that people say that it is undefined. I
    am not sure if being undefined is the same thing as not
    existing?



  2. \(a \over b\) is just a different way of writing \(a \cdot
    b^{-1}\)

  3. If \(a \cdot b = a \cdot c\), it does not necessarily follow
    that \(b = c\).


    $$
    a \cdot b = a \cdot c and a \neq 0,\\
    a^{-1} \cdot (a \cdot b) = a^{-1} \cdot (a \cdot c);\\
    (a^{-1} \cdot a) \cdot b) = (a^{-1} \cdot a) \cdot c;\\
    1 \dot b = 1 \cdot c);\\
    b = c;
    $$


  4. If \(a \cdot b = 0 \) then either \(a = 0\) or \(b = 0\).


    The above point is commonly used to find the solutions of
    equations of the form \((x - 1)(x - 2) = 0.\)



    $$
    a \cdot b = 0 and a \neq 0,\\
    a^{-1} \cdot (a \cdot b) = 0;\\
    (a^{-1} \cdot a) \cdot b) = 0;\\
    1 \dot b = 0;\\
    b = 0;
    $$



It would be really neat if I could have a sort of inline link
where I could click on the statement of 3 or 4 above, which states
both the given and the conclusion of a proof, and that would cause a
row based proof of the statement to expand out. Can I write
that?





If \(a\), \(b\), \(c\) are any numbers, then
$$ a \cdot (b + c) = a \cdot b + a \cdot c. $$


When does \(a - b = b - a\)?
$$
a - b = b - a,\\
(a - b) + b = (b - a) + b = b + (b - a);\\
a = b + b - a;\\
a + a = (b + b - a) + a = b + b.\\
a \cdot (1 + 1) = b * (1 + 1),
a = b.
$$


Prove that \(a \cdot 0 = 0\)?
$$
a \cdot 0 + a \cdot 0 =\\
a \cdot (0 + 0) =\\
a \cdot 0;\\
\\
(a \cdot 0) + (a \cdot 0) - (a \cdot 0) = (a \cdot 0) - (a \cdot 0),\\
(a \cdot 0) = 0
$$


This proof really amazes me. You start by proving that the
summation of Z is equal to Z. And then you use this fact to take
your original premise and zero its left equality. That is crazy.




First we assert that \((-a) \cdot b = - (a \cdot b)\)

$$
(-a) \cdot b + (a \cdot b) = \\
[(-a) + a] \cdot b = \\
0 \cdot b = \\
0.
$$

By adding \(-(a \cdot b)\) to both sides,

$$
(-a) \cdot (-b) + [-(a \cdot b)] = (-a) \cdot (-b) + (-a) \cdot b \\
(-a) \cdot (-b) + [-(a \cdot b)] = (-a) \cdot [(-b) + b] \\
(-a) \cdot (-b) + [-(a \cdot b)] = (-a) \cdot 0 \\
(-a) \cdot (-b) + [-(a \cdot b)] = 0
$$

Finally, adding \((a \cdot b)\) to both sides,

$$
(-a) \cdot (-b) = a \cdot b.
$$

So evidently, this is enough to "force upon us" that the product
of product of two negative numbers is positive. Hmm, I am not
quite seeing it. I can see that the steps all make logical
sense, but I am failing to actually grasp P1-P9 force the
product of two negative numbers to be positive.




P9 is kind of a big deal. It is basically the justification for
almost all algebraic manipulations



Most factorization is really just a repeated use of P9



Pretty neat example of how P9 is actually used whenever you multiply
Arabic numerals.




The numbers a satisfying \(a > 0\) are called positive, while
the numbers a satisfying \(a < 0\) are called negative.



Positivity can be defined in terms of \(<\), it is possible to reverse the procedure to mean that \(a < b\) means \(b - a\) is positive.



\(P\) is defined as being the set of all positive numbers. Note in
particular that \(a\) is in \(P\) iff \(a > 0\).




For every number \(a\), one and only one of the following holds:

(i) \(a = 0\)
(ii) \(a\) is in the collection \(P\),
(iii) \(-a\) is in the collection \(P\)






If \(a\) and \(b\) are in \(P\), then \(a + b\) is in \(P\).






If \(a\) and \(b\) are in \(P\), then \(a \cdot b\) is in \(P\).


There is a great deal here about inequalities, followed by
a rather elaborate proof showing that \(|a + b| \leq |a| + |b|.\)



Calculus

I actually took Calculus in University; I passed it with minimal effort and a C to show for it. Post university, my Calculus education was firmly in the "Plug and Pray" camp of development. Whilst taking an exam, I would see a pattern, think I recognize it from something I have seen before, and attempt to work the formula based on some other formula.

At no point did I really understand anything that was going on. Most people use addition, subtraction, multiplication, and division without understanding number theory. You CAN do Calculus without understanding it at all (I did).

However, there is a big disadvantage to learning in this fashion; retention is awful. In order to build up a higher understanding, you need "footholds" of comprehension. Often, as you gain higher understanding of a subject matter, the footholds that you built upon to get at your current elevation are forgotten (internalized might be a better word). I think this is the reason that it is often so difficult for experts to explain their expertise to a laymen.

Anyway, getting distracted. The point is that without these footholds I had a basically flat knowledge of Calculus. I had a number of formulas memorized that were each disparate flat structures of knowledge. Nothing was associated. Nothing reinforced anything else. Naturally, I forgot these formulas. Because there is no association to spark memory, once I had forgotten the formulas, I had effectively lost them.

But, this time is going to be different. I am doing it on my own. I am doing it at my own pace. If desired, I can spend days on a single concept. My simple goal for this year is to understand Calculus at a fundamental level. Such that I can naturally express problems I see in the world in terms of Calculus. I wish to have a layman's mastery of The Calculus.

Tools


  • Calculus 4th Ed. , Michael Spivak
    I picked this book as I liked the fact that it seemed to be an attempt to teach Calculus from first principles. I am not going for "can do/use calc" I am going for "understands calc". It has been so long and my knowledge was so shallow that Calculus is effectively new to me. I want a book that is going to assume I don't know anything about Calculus before picking it up.
  • This Blog:
    On this blog, I am basically just going to outline interesting problems I worked through from the book, using this blog as a sort of notebook of my progress. I succeeded in installing a really neat library called mathjax that allows you to display Tex formulas online. Bit excited by that actually.
  • Time:
    I am going at my own pace, I am not skipping when I don't understand. This is for me. I have no class I need to pass. I have no test I need to prepare for. This is for me (although you are welcome to follow along). Until I get it, the procession does not move forward!
  • You:
    I don't know if anyone will follow along, but sometimes my pace may be crawling. If you see that, and you have the time, maybe you want to leave a comment about the current problems I am having? Maybe just a word of encouragement, that helps as well. Thanks.

Friday, May 20, 2011

What makes programming so boring?

This is one of those late night thoughts, so forgive it if it is stupid.

In terms of structure, and complexity, programming has moved forward significantly. We have many new and exciting control structures that (arguably) help us to tackle greater levels of complexity. While individuals may disagree about exactly which control structures (observers, callbacks, object oriented programming, functional programming, event based programming, whatever) actually advance us, I think most agree that the level of abstraction that a programmer can deal with has gone up from the level it was in the past, thanks in large part to these control structures.

However, in terms of relatedness, that is, interaction of a programmer to his program, very little has been done. By and large, it is still just entering text. I will expand.

There is the physical act of programming a machine. This is done by entering text, executing/compiling said text, and observing the result. This has been the same for quite some time.

However, programming is not just about entering text. It is also about setting up a rhythm such that you can work. Finding a flow, that is, being interested and alert enough to tackle the next problem. This is more difficult than it sounds. Writers find flow when they are relating to their characters, when the plot interest them, when the story is intiging. Programmers constantly have jump from one idea/module/structure/file to another. These context switches are interruptions, and make it difficult to find flow. If you could "relate" somehow to the next bit of work, you might have a easier time switching to it.

Because all I do to get my program to work is enter text, I relate to my program as text. But does this have to be the case? Is there some other way I could relate to my program? Perhaps we  could anthropomorphize aspects of programming? Maybe individual modules of code could be "skinned" in some way such that they appear to be sick or healthy (depending on how many unit test they pass). Or maybe they appear confused when they aren't properly commented? Or walk around unbalanced when their code blocks don't align very well? How about bloated when a function gets too large?

I am aware that these ideas seem kind of stupid, and perhaps they are individually, but I think they point to the theme I am trying to get at. Simply stated, it is, "Can we make programmers care more about their programs if we present the program in such a way that programmers relate to them?" Currently programmers are forced to interact with pieces of text. If we could transform this text into something that could be more easily related to, anthropomorphize, or compete upon, then that would seem to be a good thing.

What your eyes physically view are only tiny little pinpricks of what you think you can see: your brain fills in a great deal of the detail. Similarly, you imagination can fill in a worlds of details, as long as it is given a few things to run with. If we could just give a few things to spark [interest/ a competitive streak/ a completionist desire] from the source code that we program, I think we could significantly increase the diligence and care that people put towards creating software.

Tuesday, May 17, 2011

A expandable editable list in Sproutcore

This is a continuation of yesterdays code.

Yesterday I built something that allowed one to have a list of items in a list wherein one and only one item could be expanded in said list. Today, I am going to expand and refine upon that idea. Specifically, I am building a list of items, where each item is a bit of editable text. Because each item is a bit of editable text, the vertical height can vary depending on how much text is entered.

Side Note: Sproutcore has the concept of a lazily loaded view container. This is very cool. It allows you to have a list of items that might contain hundreds of thousands of items, but only end up loading the ones you actually see. The catch is that each item needs to be equal in height, because the list calculates which views to display based upon the distance of the currently scrolled view area from the top. Because of this, the list being built today will not really work with lazy loading. This is because each view item in this list does not have a standard height. This really is not a issue if you are dealing with a small list of items, but it is something to keep in mind if you tried to use today's list with a huge list and using lazy loading.

What do we want?
A list, maybe 10 items or so, where each item in the list is a piece of text. Clicking on any item in the list will cause it to become editable. When editable, a item switches to a html textArea, and focus is placed in the textArea. This is a special textArea that resizes depending on how much text you put in it. Clicking outside of the editable item at any time causes it to switch from our textArea back into regular text. The size of the textArea should be roughly comparable to the size of the text when focus is removed. This allows people to gauge what their text will look like when they are done editing.

Work In Progress

Saturday, September 4, 2010

Effectiveness of mathematics

http://www.dartmouth.edu/~matc/MathDrama/reading/Wigner.html

I ran across the above essay a few days ago. I read for content the first time, and detail the second. At the bottom of the essay it basically concludes that all 4 explanations, even if they were allowed to combine their evidence, would still not be enough to explain the “unreasonable effectiveness” of mathematics.
I saw no mention anywhere in the article that one must be a mathematician (or even mathematically inclined) to guess a solution to the “unreasonable effectiveness” of mathematics. So my guess goes as such.

Mathematics is built up from a set of givens. These givens are not proven true or false beforehand, they are simply givens. Laws of mathematics are built up by combining these givens. The more observably correct laws that can be built up from any set of givens, the more likely it is that some (or even all) of the givens are true. If you are ever able to construct a law that is provably false, and you could prove that all the laws that this provably false law reference are correct, then you know that some given that “builds up” to one of these laws must be incorrect.

Mathematics, is different from other science in the sense that it is extremely extensible. The language can be extended by simply creating a new syntax, and extending a particular law/property/invariant without breaking any existing laws/properties/invariants. If the new extension “fits” within the set of existing laws, then does that make it true? Well no, but if the new extension does not break anyone else, then there is a higher possibility of it being true.

My guess is that mathematics is so unreasonably effective because it is so amazingly extendable. We simply create new mathematics every time we need mathematics to cover something new. New distributions for new types of probabilities, moving from scalars to vectors to tensors for physics, it just keeps getting added on. Mathematics is effective because mathematics is based on symbolic manipulation, which is extremely flexible.

The interesting thing to note is how rarely we hit contradiction. Perhaps this points to just how limited (and hopefully not missguided) humanities mathematical understanding is. Picture the set of givens as the root of a tree, and the laws as branches coming out of the root (it has not trunk). Some laws are built using other laws, without even directly referencing a given.

As invariants are added, the chance that another invariant will cause a contradiction to some existing invariant increases. The fact that we can still “easily” add new invariants to the tree seems to indicate that we are not even close the the “final” number of invariants.

So my guess is that mathematics is effective because it is based on symbolic manipulation, which is probably the most extensible thing humanity has ever invented, and because the “tree” of mathematics is very small, and adding new “leaves” to it is still very easy.

Tuesday, August 31, 2010

The Egg

I read the above short story a few years ago and liked it, I re-read it recently.

Do you ever find yourself hoping there is a God, an afterlife, all that stuff... but simulatenously hoping that it is a little different then established religion prescribes? Me too! Lets be clear, I am a romantic, and hope that there is a God. Rationally, I don’t really believe it, but I hope that it is true nonetheless.
I have said that I am agnostic since I was 12 or so. When I was young, I had a friend who was quite religious. He disagreed with my break with faith (not that it was ever all that strong). I told him that if I died, and found myself burning on the floor of hell, I would cry tears of joy knowing that there was something “more” to all this. That there was a God, an afterlife, and (hopefully) a reason for everything. It is a wonderful idea.  Unfortunately, I just have difficulty rationally accepting it.

I have thought about it quite a great deal, and one of my biggest breaks with the idea of God was understanding why he would allow suffering in this world. I needed to make up a reason that there could be a God AND suffering. I spent some time thinking about it. The only real solution I could dream up was that God is not in fact all knowing. Perhaps he never said he was, we just assumed. Once I groked this, I found the idea that God may not be all knowing to be a great relief. I am quite uncomfortable with the idea that God might actually be all knowing, and still choose to let humanity suffer in the fashion it does. If he did know everything, understood the ramifications of all his choices, had full comprehension of the breadths and depths of... well... everything. Well, I mean really, that would just kind of make him an ass in my book. What purpose does it serve to make us suffer, other than to pleasure him?

However, what if God is not all knowing? He may be very smart, and very knowledgeable, or whatever, but not COMPLETELY all knowing, then I suddenly get it. I understand why there is suffering. I believe he is doing  the best he can, I believe in him because he is the best qualified to lead us. I know that he is not always right, but he does his best, and he is our best. That would be a comfort. That is a God I could really get behind, it would make sense to me. I made up this idea (I am sure others have as well) about how there could be a God and suffering more than a decade ago, it is my personal story for why things are as they are (other than the great void :] ).


Warning: Spoilers Below (Why don't you read the story first?)


Ok, so back to this story. I like this story because it is a completely different explanation of the ethical problems with a all knowing God allowing suffering. One that explores a possibility I had never even imagined. In this story, there is suffering in this world because God is not in charge of it, we are. We are “fetus” Gods that are going through the lessons in life necessary to become God in our own right. God is our father, all of humanity is the God child, life is the training necessary to become as wise as our father.
A new idea! In short story form! You can’t really ask for more. A new explanation about how a all knowing God would allow suffering. You do not run across that every day. Regardless of whether it is true or not, worth reading, worth remembering.