Visualizing Algorithms
An anonymous reader writes "Many people reading this site probably have a functional understanding of how algorithms work. But whether you know algorithms down to highly mathematical abstractions or simple as a fuzzy series of steps that transform input into output, it can be helpful to visualize what's going on under the hood. That's what Mike Bostock has done in a new article. He walks through algorithms for sampling, shuffling, and maze generation, using beautiful and fascinating visualizations to show how each algorithm works and how it differs from other options.
He says, "I find watching algorithms endlessly fascinating, even mesmerizing. Particularly so when randomness is involved. ... Being able to see what your code is doing can boost productivity. Visualization does not supplant the need for tests, but tests are useful primarily for detecting failure and not explaining it. Visualization can also discover unexpected behavior in your implementation, even when the output looks correct. ...Even if you just want to learn for yourself, visualization can be a great way to gain deep understanding. Teaching is one of the most effective ways of learning, and implementing a visualization is like teaching yourself."
He says, "I find watching algorithms endlessly fascinating, even mesmerizing. Particularly so when randomness is involved. ... Being able to see what your code is doing can boost productivity. Visualization does not supplant the need for tests, but tests are useful primarily for detecting failure and not explaining it. Visualization can also discover unexpected behavior in your implementation, even when the output looks correct. ...Even if you just want to learn for yourself, visualization can be a great way to gain deep understanding. Teaching is one of the most effective ways of learning, and implementing a visualization is like teaching yourself."
Wonderful stuff. Reminded me of this site: http://www.informationisbeauti... (beautiful ways to view typically boring stuff).
The cycles of global warming
if we change how we look at things the things we look at will change
I'm sure this is fun cool stuff to play with but... I'm pretty sure my imagination is still better than what a computer screen can show me. "Playing computer" is one of the first practices most new programmers learn, and if you're good at it, it is one of the most powerful tools in your arsenal.
Here's hoping "kids these days" don't skip out on the importance of programmer's imagination over these new fangled tools.
I've always visualized what's going on, this is how I do everything. Doesn't everyone program this way? Think about something for a while, building up the model in your head, then visualize the interactions among the parts. If the problem is too complex to visualize, then I simplify and add abstractions until I can visualize it. This iteration naturally creates simplified abstract layers in my code.
I debug most of my code this way also. When I'm internally visualizing stuff, I lose track of what's going on around me. I wouldn't be surprised if a brainscan would show activity in my visual cortex.
check things out as they really are as opposed to the media hypenosys maybe?
Many people reading this site probably have a functional understanding of how algorithms work.
Humorist.
From the standpoint of governance, what is at stake is our ability to use the rule of law as an instrument of human redemption. -
-Al Gore, NYT, 2/28/2010 "We Can’t Wish Away Climate Change"
'Human redemption', Al. Really? Is your theological head lodged that far into a lightless location?
Algorithms should be executed by computers, not developers. Viewing how an algorithm works reinforces procedural thinking which is a dangerous habit for students. The whole point of teaching recursion with the Towers of Hanoi is to show that procedure is best done mechanically, while the programmer only has to think about the correctness of the algorithm. Once a student capitulates and really gets the point about building correctness, not procedure, then sure, show them the mechanical fall-out. But you would not believe how many professional programmers are painfully limited in what they do by their belief in what algorithms are.
https://www.youtube.com/watch?v=kPRA0W1kECg
I'm not affiliated with the author in any way, but I did buy the book (though you can get it for free).
This is an amazing resource for someone new to D3.js's declarative javascript and helps you put it all together: https://leanpub.com/D3-Tips-an...
After using D3.js, I've come to the conclusion Mike Bostock is awesome! But it doesn't stop there, people have expanded it like Crossfilter and dc.js.
Tech that allows a javascript n00b like myself to build a simple race results visualization.
Comment removed based on user account deletion
in explaining how things really are.
Light is a continuous signal. It must be sampled at an interval to be determined and interpreted. It actually flows like a river. Amazing.
- Zav - Imagine a Beowulf cluster of insensitive clods...
Using a bunch of sample points to represent a function is fundamental to computational physics. Stress Analysis, Colorful oops Computational Fluid Dynamics, Computational Electro Magnetics etc etc. Solution adaptive meshing is a very popular technique in these algorithms. Make a crude mesh and compute a crude solution, use the gradients in the function to determine where the "cells" are too large or the representation is too poor. From there we go to "p" refinement where we jack up the order of mode shapes in the finite element, or "h" refinement where we refine the mesh by adding points, or "r" refinement where we move the mesh points from less important regions to more important regions.
In the "h" refinement technique one would insert points based on cell-centroid, cell-circumcenter or longest-edge-bisection etc.
This work, which seems to be 2D, these techniques are first published back in 1980s, and it was extended to 3D in 1990s.
The commercial CEM package made by Ansoft to solve 2D electromagnetics called Maxwell was using the Voronoi polygon based refinement of 2D meshes. It shipped in 1990. They were doing 3D Voronoi polyhedron based solution adaptive refinement of sample points in 1993 version of their 3D product HFSS.
http://www.google.com/search?q...
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
I do agree this is very cool. However, couple years ago, someone tried to do visualization of Calculus (don't have the link,but I am sure I read about on Slashdot) with relative success of explaining simple ideas like volume and areas. But past simple ideas, it failed to "visualize" abstract ideas like substitution.
It was a simple visualization of different sorting algorithms by using the memory mapped screen as an array and filling it with random visible ascii characters. Then you could watch as each sort moved the values around on the screen. I was very new to programming but it gave me a real sense of how many different ways you could do one thing. I also gained a great understanding of how different sort algorithms worked.
Visualization is also great for evaluating randomness; remember the images of broken RNG implementations a few years ago? http://lcamtuf.coredump.cx/new...
You kiddies probably don't even know what a flow chart is, much less how to do a good one....
mark
I have been working on an algorithm that predicts the outcome of sporting events based solely on weather variables. I have improved each year and now I am winning handicapping contests and making money every year. I have developed another algorithm that predicts the temperature that is based solely on lunar cycles. I know that they can be improved, but I lack the knowledge and skills to do it. If anyone is interested I would be happy to share what I discovered.
More fundamental CS though: http://www.cs.usfca.edu/~galle...
A 21st century issue: the irony of technologies of abundance in the hands of those still thinking in terms of scarcity.