Archive for May, 2009

Today’s Top Tech

Digg.com is unique in that each page that it renders is the result of many http requests to many different servers, each which loads some widget or box on their website. They are testing a new technology (you can test it free too, see the link) that lets you basically do this through one connection, and control the order of how each request/item is loaded on the page. Interesting!

http://www.readwriteweb.com/archives/digg_demos_optimized_datastreams.php

Best Practices for Optimizing Websites by Yahoo, Really Informative, goes into detail from structuring CSS / HTML to server hosting

http://developer.yahoo.com/performance/rules.html

How to Design a Database - What to think about so you don’t run in to trouble later; set yourself up well to scale and prosper

Databases From Scratch III: The relational database design process

Tags: , ,

Further Thoughts on ‘Thinking out of that dang box’

The last post was rather lengthy, so I’ll be concise. Sometimes you don’t have time to write things down, and build up a large detailed model. If you are in a group, and the group is struggling to be innovative, here is a quick strategy to generate different thoughts. AgainThis strategy is more for idea generation as opposed to solving a problem start to finish.

The strategy is to put your problem in the form of a specific and detailed question, pick out the ‘power words’, and then ask yourself questions about those words.

For instance, in the last post, the example was “how can a rectangular cake with a rectangular slice be cut in half with one straight knife cut?”

Now, let’s use our strategy of idea generation just to wander our thoughts and see what cool stuff we can think of. Using the strategy, we parse out the important words:

“rectangular cake” “rectangular slice” “cut” “half” “one” “straight” “knife” “knife cut”

Remember, we are just generating cool thoughts at this point, nothing else. At this point, we ask ourselves whatever questions come to mind.

- rectangular cakes
“what if i threw that cake up in the air?”
“What are different types of rectangular cakes?”
“Are all cakes rectangular?”
“Why are cakes rectangular?”
“Rectangular cakes are like ‘the box’ that we can’t think outside of”

-cut
“What are different types of cuts?”
“How does one make a cut?”
“What if I used a sword to cut?”

-half
“half of what? half of the volume? the surface area?”
“what if we were in 4 diemsions, what would half a cake be?”
“what if I paid a mathematician to solve ‘half’ for me”

-straight
“straight as in arrow-straight or straight as in non-gay?”
“what else is straight?”
“what is straight but isn’t like an arrow straight?”

-knife cut
“what else could we use besides a knife?”
“what do the things we use to cut a cake with have in common?”
“what are different ways to cut?”
“how do chefs cut?”
“why do we usually cut slices like we do?”

Anyway, as you can see, you can generate a lot of thoughts simply by parsing the sentence and asking yourself questions about the individual objects, possibly connecting thoughts across domains that you wouldn’t have beforehand.

Thanks for reading.

Nate

What is the box, and what is this ‘thinking outside of it’ business?

You have heard it, whether it was from your group mates, your teacher, your boss, or someone else. “Think outside the box” they all say. Well, what does that even mean, and how do you go about doing it?

Most people don’t even realize that the box is an analogy for ‘Context.’ Thats right, context. Let’s take the statement “Girls have long hair.” This may make sense to you right off the bat, but what happens if we tried to tell a computer “girls have long hair.” The computer would immediately be confused and ask a whole bunch of questions:

- What types of girls? Human Girls? Female Giraffes?
- What is considered ‘long’? How long is long? Long relative to what?
- Where is the hair? Armpit hair? Leg Hair?
- What does it mean to ‘have’ hair? It grows on them? Do they have lots of braided wigs?

The point is that we humans - you and I - automatically infer context from statements. With “girls have long hair,” we infer that we are talking about human females whose hair on their head is longer relative to that of male humans on earth - something like that. We inferred that we are talking about humans females, that we are on earth, that the hair is on their head, without really even thinking about it.

Well I’ve got news for you… This is the box! Yes, these are all ‘contextual properties’ that make up the ‘context’ of the statement that “girls have long hair’; this context surrounds and constrains the scope of the statement so that it makes sense to you and me; it supports the statement and makes sure that you don’t think of questions such as “are we talking about head hair or armpit hair.”

Now you are aware that you (your brain) infers many things automatically. Realizing this is the first step to working your way out of it. (so called ‘thinking outside’)

The second step is then to explore the space and start questioning (My Favorite Part!). Now, let’s take another situation to think about these ideas. Let’s take a puzzle for an example.

“Given a rectangular cake with a rectangular piece removed, how would you cut the remainder of the cake into two equal halves with one straight cut of a knife?”

Now, often our first step is to imagine a cake in our ‘mind’s eye’ with a slice removed. Reasoning just in the head is the first flaw of people who can’t ‘think outside of the box’; the reason is that the mind is not that good at holding images in it for a long time — think about it, its hard to manipulate images in the ‘mind’s eye’; also, as we showed before, when you think up something in your ‘mind’s eye’ you are constraining your thoughts to a certain context - in this case, possibly a certain prototypical cake, maybe its on a table or something or maybe it is twice length by width, or something like that. This is a problem! See? Immediately your mind must constrain the thoughts so you can ‘imagine them’ in your minds eye (its just part of how the brain works); but what you want is your mind to think of differently!

Thus, you ALWAYS should have a pen and pencil, and immediately draw a picture of that mental image you have in your mind’s eye. The picture should be extremely neat so that it is easy to identify the ‘features’ of the space.

I have introduced a new term here that I want to highlight - ‘features’ of the space. These are the ‘variables’ in the space that we will be changing here and there to explore the space and find its boundaries- keep reading and you’ll get a better grasp of what I mean. Basically, these allow you to ‘find out what you can do’ in the space.

Now, back to the Cake example. So, we have a neatly drawn picture of a two dimensional cake. Mine looks something like this:

A simple rectangular cake with a rectangular slice removed

A simple rectangular cake with a rectangular slice removed

Does yours look like this too? Cool.

Now, let’s take a step back and notice a few things about our drawing. First, in our minds, it represents a cake. In our minds, essentially, it is a model, or a surrogate, for a cake. Do you notice whats going on again?

Yes, our minds are again simplifying and constraining our thinking! Show this odd rectangle to another person, and they will say “what the hell is that?” They will have no clue that it is a rectangular cake with a rectangular slice removed. This is far from a cake, but your mind has again inferred the ‘contextual properties’ of this cake;

Here’s some stuff wrong with our model:

- this picture clearly has no ‘frosting’ attributes that are visible
- this picture clearly is only two dimensional
- this picture has 90 degree edges
- a lot of other stuff

That’s why a real cake would be much more useful in trying to find the answer to our puzzle! Alas, we have no real cake, so we must get past our brain’s simplified model of a cake (and all our brain’s constraints) and try to build as good and detailed a model as we can. Then, we can explore the ‘feature space’ and try to solve the puzzle.

Let’s improve our drawing a bit, shall we?
- A real cake can have a number of toppings and frostings
- A real cake is made of cake batter
- A real cake is three dimensional (just like all objects)
- A real cake has rounded edges
- A real cake is soft and fluffly

Now, we have created a better model; go ahead and (seriously do this) draw it out (how long does it honestly take to draw another cake? It will help you in the long run I promise) mine looks something like this:

Okay, so I cheated and searched google for an image instead - big woop. Anyway, we see that our cake now has colors, it has frosting only around the edges, it even has some objects on top of it (a transformer, presumably), and a title.

Awesome, this cake is a good enough model for now. Your model must be detailed and good enough before you can begin exploring the ‘feature space’. Just think of as many details as possible, and you’ll be fine.

Let’s finally begin exploring the ‘feature space!’ As I said before, the feature space is our ‘moving room’ in the box; essentially, there are a lot of things that don’t have to be, or that could be changed. Essentially, there are ‘variables’ that we can change.

One such variable may be the color of the frosting we use; another such variable is the type of frosting, or what the cake is made of.

The first step though, is writing the properties of your model down. This means that we write down ‘properties’ of cakes. Let’s do this. Now, don’t constrain yourself to the problem yet, just write down ANY properties of cakes. This is the part where your imagination comes into play.

Most importantly, ASK YOURSELF QUESTIONS TO HELP EXPLORE THE CAKE SPACE!

Always ask yourself questions to help you explore the space!

What is it like to eat a cake? (maybe from this you’ll realize they have different textures)
What do I eat a cake with? (maybe you’ll realize how soft cakes are, or how they are even sometimes hard, or melty if they are an ice cream cake)
Where have I seen cakes? (maybe you’ll think of wedding cakes, birthday cakes, different sized cakes, different layered cakes, etc)

All these show you new properties of cakes that you didn’t see from your initial model that you drew on the paper.

Some questions constrain your thinking though, so beware. For example:
“How big are most cakes?” - (may lead you to think again of just medium sized cakes; you don’t want to constrain yourself at this point at all. If this happens, you should realize you are constraining yourself again (be self-reflective!) and should start thinking of exploring different questions).

After asking ourself many questions, our list looks something like this:

Overall Shape (circular, rectangular, pyramidal, etc)
Number of Layers (one, two, cascading, getting-smaller-as-you-go-up, same-sized-layers, etc)
Base Substance (ice-cream or cake batter)
Ingredients ( salt, butter, water, sugar, yeast, etc)
Dimensions ( rectangular, circular, pyramid)
How it was cooked (baked, however else they make cakes)
Frosting type (sugar free, sugar)
Objects on cake (symbols, physical objects, cards, etc)
Writing on Cake (names, etc)
Who the cake is for ( son, dad, brother, etc)
What the cake celebrates (birthday, graduation, anniversary)

Now, all these details are some things that we can add to our model. The physical model that we have drawn on the paper helps us identify all of these different properties, because we can infer them simply by looking at the picture we have drawn, which is great! Also, when we draw them, it helps us think of even more and envision them better! Amazing! This helps our imagination greatly.

Now, instead of thinking of possibly thousands of properties of cakes, THIS is the point where introduce some constraint. What constraints to we introduce? Well, the puzzle defines the constraints perfectly for us. Let’s see what the puzzle says again:

“Given a rectangular cake with a rectangular piece removed, how would you cut the remainder of the cake into two equal halves with one straight cut of a knife?”

Okay, so our first constraint was actually that the object was a cake. We got that down, but didn’t limit ourselves to our first thought of a cake. Instead, we built up that model of a very detailed cake before we constrained it down. (Think about how much richer your model of a cake is now, as opposed to a cake you thought of at first - see how many more ‘possibilities’ there are with a detailed model? There are more lines and avenues of thinking you can take when more details are presented to your model).

Our second constraint is that the cake has to be rectangular. So on our list, we need to make the cake rectangular, so under ’shape’ where we had ‘circular’ and ‘rectangular’, we have to cross off circular and all the other shapes. (You don’t really have to cross it off, but in your mind what you do is create this constraint that stops thoughts from propogating into that direction, i.e. into thinking about different shapes of cakes. This is basically creating a ‘wall’ in your thinking. In this cakes, circular cakes are irrelevant because they won’t solve the problem, and you need your mind to think in the right direction - rectangular cakes). This is a hard constraint, like a brick wall, which helps guide us in thinking in the right direction.

We may have other questions such as, “Okay, can the cake have more than one layer? What if all the layers are rectangles?”

These are awesome questions! Whoever asks this puzzle should tell you (i.e. constrain) the problem for your correctly. In this case, we will deal with a one-layer cake.

Our third constraint is that a rectangular piece is removed. Now, we again have to build up a rich model of a ’slice’ so our brain doesn’t limit us to a basic model.

“could it be just the top layer / frosting slice, or does it have to be a complete cut from top to bottom?” “does the slice have to be rectangular in all dimensions?”

In this example, let’s clarify and say it has to be rectangular in all dimensions, and is a complete slice from top to bottom.

Now, we should have a pretty detailed picture of the cake. Now, I’m basically going to use this method described above over and over again to solve the rest of this problem, writing my thinking out. Its really a trial-and-error, which sometimes scares people, but if you guide your direction in the right thinking, you are almost sure to find at least one correct answer. Let me write out the general strategy I showed you, and that I will be following:

1. Imagine model of what the puzzle asks in my minds eye (our mind’s eye image of a cake)
2. Draw that model down (our initial drawing of the cake)
3. Take a step back and ask myself questions about the model - anything that jogs my memory
4. Enhance the model and find as many details as possible -explore the feature space (write down details and redraw cake)
5. Write the details down
6. Use these details and identify general ‘properties’ of the system (i.e. shape / dimension / types)
7. Constrain down these properties using the constraints in the problem
8. Use constraints as guides; don’t think against constraints (i.e. don’t think of ANY circular cakes, this problem is about rectangular cakes.)
9. See what you can come up with, don’t be afraid! Never be afraid to try something, because if its wrong it gives you so much more information to make your model better!

Simplified:

1. Imagine
2. Draw
3. Enhance
4. Explore feature space
5. Constrain
6. Follow threads of thinking

Now, here we go. Starting from our ‘enhanced cake model’:

“Given a rectangular cake with a rectangular piece removed, how would you cut the remainder of the cake into two equal halves with one straight cut of a knife?”

“Where is the rectangular piece removed from?” —> The sides? The corners?

Hmmmm…..let’s try the problem if the cake slice was just removed form the corners….
I would have to have a line that bisected the cake; a normal bisector would just be diagonal across the cake…

With a slice removed, could i just start at the far corner, and then find a point that would have equal cake on both sides? –> wait, this doesn’t work, because remember we made an assumption that the slice was removed from the corner? The slice could be in the center…

Okay, so maybe there are two situations, one where the slice is in the corner, and the other if it is on one of the sides…

Let’s say its just on one of the sides… –> in the middle of the side? –> close to the corner?

Lets assume its in the middle of the side of the cake…. —> which side? small side? long side? does it matter, or are these situations symmetrical?

Hmmm… they may be symmetrical….Let’s assume that its in the long side of the cake …. —> okay

Hmmmm…..well right now i seem to be looking for one line to bisect the cake, what if i try two lines? (generalize)

Well, then where would these two lines start? –> probably at the corners?

Let’s assume both lines start at the corners, then we’d basically have to find the areas of both of these new pieces, which seems fairly difficult… –> maybe we know how to do it using pythagorean theorem, or something like that

Maybe i know how to do that, but it seems really difficult; besides, I just realized that the cake slice could be directly in the middle of the cake - I should have realized this earlier when I was trying to place the cake slices in different places - darn. Also, I forgot that according to the puzzle we only have ONE straight cut… okay, Let me go back to where I was thinking initially.

So now I realize that the cake slice can be anywhere, in the middle, corner, or edge and I see it more clearly on paper and in my minds eye, which is a better constrained model so I can think about it better.

Now, I guess I have to cut it in a straight line –> what constitutes a straight line?

Do I just have to keep the tip of the knife straight to make a straight cut, but could I move my wrist while keep the knife cut straight? –> no, that would lead to a non-rectangular slice, maybe conical, which is not allowed

Okay, lets mess with the cake as a whole. What other properties matter? What doesn’t matter? –> colors and taste don’t seem to matter, neither do whats on top of it seem to matter’

Okay, well, what general properties are important in this case? –> Space, how you divide that space

Okay, so yeah spatial properties are pretty important, what are the spatial properties of the cake? –> has a length, width, height

What can I do to the cake spatially? –> “What happens if you flip the cake upside down?”

Okay, then I guess I could cut it differently… hmmm… –> would it be easier to bisect this way?

—-> (my mind somehow makes a connection when it sees that I can cut it across wise, instead of looking at the cake from a ‘top view’, i would look at the cake from a side view and cut perpendicular to the height)

AH! Okay. I understand now. Say I were to place the cake flat on a table, and cut a rectangular piece out. Then lets say i hunkered down and looked eye level across the surface of the table so that I only saw the ‘height’ of the cake, i.e. one side. Say the cake was 4 inches tall, then at 2 inches high i would make a horizontal cut across the whole cake. This would divide it in two - into top and bottom halves, regardless of where the rectangular slice was made! We wouldn’t have discovered this if we had stayed with our original, simplified, 2D model of our cake.

The cake slices could be seen in red (if the cake was turned on its side), seperating the cake into ‘top’ and ‘bottom’. This solution does assume, however, that the rectangular cake is symmetrical along the height axis. For us, this is good enough for now.

Now, as of this writing, I got to thinking of so many other possible ways to do this! What if the cake was an ice-cream cake? Then we could simply melt the cake down into a liquid, put it into a measuring cup, and walaa, we could easily then have seperate the cake into two equal slices (more like blobs), saving ourselves a knife cut!

Let’s reflect for a second.

Its important to note that at the start of the problem we didn’t realize which properties were important. Color? Frosting? Type of cake? Shape? Over time, however, we were able to constrain the problem more; we use the constraints in the problem to get us thinking in the right direction, and we tried to never think things that violated those rigid constraints. Let me say that again, we let those guide us, we road them like a river, skimming our hands across the water to make sure we were on the right path, and we pushed the boundaries.

Especially, we were able to ask ourselves ‘which properties of cakes and cutting them are useful?’, and were able to think that spatial properties were useful and explore that area. This helped guide our trial-and-error in the right direction.

Here’s a few slogans to remember:
1. Ask yourself questions to enhance your model
2. Build a detailed model
3. Write things down
4. Use Constraints as Guides
5. Identify the ‘feature space’

Most people start out too constrained and later have trouble generalizing and finding more details. Instead, you know the following:

1. Start out very detailed and general, removing contexts
2. Identify constraints that are rigid, and those that can be removed or changed
3. Use the most rigid constraints to guide your thinking
4. When you are stuck, either go back to a previous step, or again try to remove constraints or get more details and generalize from there; most importantly again, use questions to help guide you!

Be persistent! We had to ask ourselves so many questions before we got to the answer, but in the process we thought of more than one!

Thanks for reading!

Nate

Response to “Many AP Test Instructors See Problems with Program”

Original Article printed in the New York Times, Jacques Steinberg

I’d like to quickly respond to some of the inferences and ideas presented in the article. To quickly summarize, the article conveys how a growing number of high school students are taking Advanced Placement courses and exams for pragmatic reasons - getting into better colleges mainly - instead of simply being ‘intellectually curious’ and having some sort of innate love for higher learning.

First, I would like to say that this article is rather misguided, and that the parties involved are increasingly unaware of what it is actually like to be a high school student, especially a high school student in the current day.

The article is misguided because the term ‘intellectually curious’ is a wet-dream; yes, I loved science and engineering because they taught me about the world and it was cool, and maybe this played a little part in motivating me to take harder classes, but when I was in high school really a lot of it was the structure my parents created for me, their encouragement,  pressure they applied, my own competitiveness to win, wanting to beat out the others, no doubt. Intellectually curious? Not really, I just wanted to be the best. I didn’t care what it was, science or checkers or pogs. Now I am beginning to understand my own motivations, and encouraging myself in other ways; but in high school, very few successful students do it on their own, or from their own ‘curiosity.’

Our culture is changing, things are getting more aggressive and competitive; we know that competition breeds innovation; but seriously, students pushing themselves to learn more is never a bad thing, and I can’t imagine why anyone would ever think it was.

“But they are doing it for the wrong reasons” — you say. “That’s bullshit,” I say.

People do things for a variety of reasons; just because you get off on that ideological dream that scientists or smart people are innately curious doesn’t mean that’s how it should be, or even how it is now.  Some scientists are in it for the money. Some scientists just want a job to pay the bills.

You’re not allowed to pick the motivations for someone - they do that on their own.

In the article, I find it absurd that some teachers think that “students are not ready for these College Level Classes”. If a student is going to push himself, why the hell would you ever say ‘no’? Can you imagine, even through suffering through a hard year of class, how much that student will learn and grow? Why would you want to keep students on the ‘dumb track’? Students are getting smarter by my estimate (not those stupid ’standardized exams’ no one gives a shit about). The internet is especially changing this, allowing students access to so much knowledge; they are informed as hell, and its awesome.

And by ‘Smart’, I mean having enough understanding of the world and of people to adapt and survive within a certain niche or situation. Basically being the most fit for any environment(think natural selection), which technology enables via a computer screen (think how many niches you can connect with). Who cares what that situation or niche is, you can find a place for yourself and flourish. For example, you can only know how to write c++ computer programs, or you can only know how to create a web page. Either way, you’re smart if you’re able to find the niche where these skills are useful.

By the way, I went to a fairly accredited public school, and trust me, AP Classes are NOT college classes by any means. Students are ready to challenge themselves — its time to let them.

Tags: , , , , , , , , ,