Sunday, December 26, 2010

SS - Carillon

Fractal art is awesome.  I have a weakness for patterns and a weakness for digital artwork, much in the same way that I have a weakness for coffee or afternoon naps.

This particular piece just 'clicked' for me:



It's called "Carillon".  It was made by the awesometastic Golubaja, who let me use it for my header!  Her work is amazing, you should really check out her porfolio, here!

Saturday, December 25, 2010

QS - Fuzzy Logic in a Nutshell

Suppose you are driving to a theater you have never been to before. You are on the correct street, but are unsure of the exact location of the building. Rolling down your window, you ask a passing pedestrian where it is. The reply that comes is: ``Drive a little farther, and you will see it to your left." From there, finding the theater is almost trivial, as you intuitively follow your notion of what ``a little farther" is. Mathematically, however, those words are not so straightforward. What does “a little farther" mean? The phrase is fuzzy

From bigoo.ws
 
Another good example is that of colours.  Take a look at the picture of the green shamrocks. Each shamrock has a different 'shade' of green. Some even have yellow splashed on! So what is "green"? The colour is fuzzy!




 


Lotfi Zadeh founded Fuzzy Set Theory (FST) in 1964, to make set theory more intuitive and applicable to the real world.  FST adds to the 'intelligence' of machines. Here's an apt quote by Bart Kosko and Satoru Isaka:

“The binary logic of modern computers often falls short when describing the vagueness of the real world. Fuzzy logic offers more graceful alternatives.”

FST is different from Classical Set Theory, which says that an object either belongs to a set or it does not. In school, we learned that all hypothetical objects can be divided into sets – groups of like objects. If a particular object does not lie within a set, then it belongs to the set’s compliment. In real life, however, we cannot classify things so easily.

Let's look at the shamrock example again. In FST we could define a set called "Green". Each of the different shades would lie to different extents within the set. Associated to each shade would be a membership number, i.e., a number that indicates how much the shade lies within the set Green. Therefore, a fuzzy set can be thought of as a bunch of memberships. Once we define a set, we can compare two or more shades of green. We’d be able to say this colour is greener than that one, for it lies to a greater extent within our defined set, i.e., it has a higher membership. I won’t get into technical details just yet.

Now that I’ve explained on a very basic level what fuzzy logic is, let’s look at why it’s useful. Fuzzy logic has its home in the realm of Artificial Intelligence, or “the science and engineering of making intelligent machines” according to John McCarthy who coined the term in the first place. An intelligent machine is one that bases its actions on its environment. Basically, it perceives what is going on, and makes proper decisions. The decisions are made based on fuzzy IF-THEN rules.

There are a myriad applications for fuzzy logic. It’s used to regulate temperatures and/or water levels in air conditioners, washing machines, dishwashers, microwaves and more. It’s used in digital image processing, robotics, and classification algorithms. It's even used in medical diagnosis.


A very interesting application is MASSIVE (Multiple Agent Simulation System in Virtual Environment), which is a software package used for generating crowd-related visual effects for film and television. Movies like Avatar and Lord of the Rings have included MASSIVE to depict large-scale armies enacting random yet orderly movements.


Slightly more Technical – Only Slightly!

A fuzzy set can be thought of as a membership function that lets us know to what an extent an object lies in a particular set. Let’s take the hypothetical example I started with - that of finding the theater. Consider a fuzzy set How-Far which defines the farthest possible distance from where you are as 100 meters.  Therefore, any object that lies 100 meters away from you will lie completely within the set, with the highest possible membership of 1. (As this is a hypothetical example, we shall assume distances beyond 100 meters are not possible.)  If the theater was 30 meters away from you, then it would have a membership of .3 within the set.  Therefore, without knowing it, the pedestrian actually described an object with the membership of .3 as being ``a little farther" away, thereby giving a mathematical meaning to these words!


Without getting into the mathematics of FST, here are a couple of points to keep in mind about fuzzy sets and memberships:
  • Memberships lie in the interval [0,1]
  • If an object does not lie in the set, it has a membership of 0
  • If an object lies completely within the set, it has a membership of 1
  • Fuzzy sets can have a number of shapes, such as those shown in the figure.





These are just two examples of the many shapes that a fuzzy set can take.  Another common fuzzy set is the Gaussian.  In the example given, the attribute value would be the distance from where you are.  So, the theater would have an attribute value of 30 meters, with a membership of .3.


Fuzzy decision systems use pairs of fuzzy sets in the form of IF-THEN rules in order to make decisions.  I won'te get into decision systems right now, but there are plenty of awesome materials out there to leaf through if you're interested!


Here are a few:

Basic Understanding for Beginners

Fuzzy Thinking: The New Science of Fuzzy Logic by Bart Kosko
Fuzzy Logic: The Revolutionary Computer Technology That Is Changing Our World by Daniel Macneil

For Further Study

Fuzzy Sets, Fuzzy Logic, and Fuzzy Systems: Selected Papers by Lotfi A Zadeh edited by George J Klir  & Bo Yuan
Fuzzy Models and Algorithms for Pattern Recognition and Image Processing by James C. Bezdek, James Keller, Raghu Krisnapuram, and Nikhil R. Pal

Links

MATLAB & Simulink based books: http://www.mathworks.com/support/books/index_by_categorytitle.html?category=9&sortby=title
Tutorials:
http://www.fuzzy-logic.com/
http://www.seattlerobotics.org/Encoder/mar98/fuz/fl_part1.html#INTRODUCTION



Sunday, December 19, 2010

SS - Black Cat with Green Eyes

I had a dream some time ago in which I had a pet cat named Blade.  He was black with green eyes, and somehow I could talk to him. Blade was a wise little fellow, and would help me with the obstacles I encountered - I don't remember much of the actual dream.  He would sit across my shoulders and sniff at the people around me as though he were an arrogant king sitting on his throne.

Needless to say, I've been hoping I'd dream him up again.  But I haven't been able to. :(  So I decided to randomly google 'black cat with green eyes' and ended up finding this beautiful pic:




This is where I got it from.

I absolutely love cats and would love to be owned by at least one, but alas! I'm allergic to cat fur.

Saturday, December 18, 2010

Delicious, Magical, (and Healthy!) Chocolate

Diamonds are pretty, yes, but dark chocolate is my best friend. Milk chocolate is a friend I occasionally call to grab a cup of coffee with.  White chocolate is an acquaintance who is too dull and pathetic to call at all! Hell, white chocolate isn't even 'chocolate' in my books. (Cue hate mail from white chocolate fans.)

I love chocolate in just about *any* form from brownies to hot chocolate to candy bars.  I've always eaten small amounts of chocolate guilt-free because I read once that cocoa is good for health.  But I've never known just *what* it's good for.  So I decided to find out!



From chennai-grocery.com





Unfortunately, I found that commercial chocolate does not have the health benefits that raw cacao does, probably because of all the processing it goes through.  Raw cacao has tons of compounds that are required by the human body: zinc, iron, fiber protein, calcium, etc.  It contains magnesium, which acts both as a muscle relaxant as well as a bone strengthener.  It also contains sulfur which helps keep nails and hair strong. Raw cocoa is brimming with antioxidants, which have a truckload of things they're good for.

And, as we all know, it contains caffeine, consumption of which is one of the top 6 ways to boost brain power, according to a  recent Scientific American MIND report. Yippee!

While I've cut down on hogging commercial chocolates, I've started making hot chocolate with raw cocoa  and fudge brownies with whole wheat!

Here are the recipes:
Hot Chocolate from Raw Cocoa - Hershey's syrup, in comparison, is like a sneeze  sitting on the tip of your nose, depriving you of a sweet, quick release, leaving you completely dissatisfied.
Eggless Fudge Brownies - I use whole wheat flour, instead.


Another one that looks good that I haven't been able to try is: Barcelona Hot Chocolate

For more info on health benefits:

If you're interested in making chocolate from scratch at home, Chocolate Alchemy seems like a great site.  I often visit it randomly, hoping that I'll eventually have the patience (and money!) to make chocolate straight from the beans, at home.

Wednesday, December 15, 2010

SS - Spinning Dancer Illusion

I'm getting terrible at posting Sunday Snaps on *Sunday*. Every Sunday I think "Hmm what should I post? Eh, I'll do it later." And then 'later' turns out to be Wednesday or Thursday. Or the following Sunday.

Anyway, this is one of my favourite optical illusions:


The dancer is spinning in *both* clockwise and anticlockwise directions. I picked this up from Mighty Optical Illusions - a fun site to procrastinate with!  Here is this illusion's full post.

I prefer the dancer to the spinning cat optical illusion (shown below in the expanded post) as it's much harder to 'switch' the dancer's directions than the cat's.






I really think that this should be called "Schrรถdinger's Dancing Cat" since it's spinning in two directions at once... Did I hear a groan?

What? I'm cheesy! Deal with it.

Tuesday, December 7, 2010

SS - Coffee Break

Here's a design I made for a tshirt contest in August.  The theme was: "What do you feel when you wear cotton?"

Cotton, to me, is comfortable.  And when I'm comfortable, I enjoy sipping on a steaming cup of the drink of the gods: coffee!


In order to make it more 'me' I added a bit of geekery to it.  This design actually depicts an infinite loop in the programming language C.  Basically, it says "I don't work. I just keep taking coffee breaks", since 'work' is commented, i.e., the line that says 'work' isn't executed at all.

Unfortunately I never heard back from the people holding the contest.  Not even an acknowledgement of receipt or anything.  Which makes me think I sent it to the wrong address! (That actually sounds like just the sort of thing I'd do.)

Ah, well!