This article on The Atlantic and this New York Times one give a grim look of Venezuela today:
- Children are being robbed.
- Courts are closed on most days.
- Lufthansa just announced that it’s cancelling all flights to the country.
- Lack of medicines is causing people with curable illnesses like epilepsy to die.
- Entrepreneurs are being threatened with jail because of toilet paper.
- The government says it can no longer fund school lunch programs.
- Burglars have assaulted 11 times in the last year the university where all the country’s response to tropical epidemics comes from leaving them with no equipment to do anything.
- Low oil prices (the country’s main export).
- Oh, and there is a drought on a country with crumbling water infrastructure and one of the worst Zika epidemics.
The article’s reasons for how things got this bad? Corruption and Chavism mixed with major bad decisions and bad luck. Example of bad decision making: the government fixed prices on basic goods with the goal of ensuring that everyone would have access to them. Sounds reasonable but the problem is that once you fix prices if costs go up for the producers they will stop those basic goods and you won’t be able to buy them anywhere.
This is a compilation of algorithms, interview questions and other resources. It is intended for students who want to become professional software engineers and a reference to professionals.
Techniques and classes of problems
(Taken from ZOJ Forum)
- Dynamic Programming
- Greedy algorithms
- String management
- Simulation problems
- Abstract Struct Problems
- Search Problems
- Number Theory Problems
- Geometry Problems
- Tree Struct Problems
- Graph Problems
- Matching Problems
- Combination Problems
- Shortest Path Problems
- Game Theory Problems
- Maximum Flow Problems
Software Engineering interviews
Algorithm to solve any algorithmic problem
- Understand the problem statement
- Run through an example
- Come up with the easiest solution
- Explain the solution
- Prove that it works
- Is it the fastest that you can do? If not go to 3.
- Watch-out for special cases
Few divide-and-conquer problems:
– nearest pair of points (2D) in O(nlogn)
– counting inversions in an array
– array shuffling
input : a1,….an,b1,…bn
A few dynamic programming problems by name:
– Max contiguous sum in array
– Max subset sum of non-adjacent elements in array
– longest increasing subsequence
– longest common subsequence
– shortest common supersequence
– longest oscillating subsequence (google interview question)
– longest accelerating subsequence
– longest Arithmetic Progression subsequence for unsorted array (google interview question)
– Matrix chain multiplication
– maximum value of expression consisting + and *
– minimum number of palindromic substring
– cutting stick (ACM UVA problem)
– 0/1 Knapsack
– counting ways of making a change
– Min. number of coins for a change
– 2-partitioning a set with/without repeations of items minimum sum difference
– Edit distance
– convert string to palindrome with minimum deletions /insertions
– Max. rectangle sum
– Max rectangle/square submatrix of 0 and 1
Do you know any other good algorithms resource? Leave it in the comments!
Humans are curious creatures.
What is the sound of one hand clapping in the desert?
To be continued..
Special thanks to Reinoud for asking me about the comic for weeks and pushing me to complete it and to Killerpijos for beta testing the original version and giving valuable feedback.
Today I read this article from PresentationZen about the following wonderfully crafted presentation from Sir Ken Robinson on the topic of education and creativity. On it Sir Ken explained, among other ideas, the difference between creativity and divergent thinking which I found fascinating (min 7:48 in the video).
Before going any further if you have a few spare minutes imagine a paperclip and give yourself as much time as you want to come up and write down a list of all the things that you can use a paperclip for like for example bending it to make a hook. Once you can’t come up with any new ideas scroll down past the following depiction of slnc doing that same exercise a few minutes ago.
How many uses could you come up with? Less than 15? If so take a look at this list to see what you might have missed:
- clip papers with it
- clip your nose and make your kids smile
- twist it around several cables to keep them together
- twist it and open use it to open locks
- unroll it to make holes in bland surfaces
- unroll it and make it circular and you will have a ring
- if it’s a big paperclip unroll it and make it again circular and you will have a bracelet
- unroll it and then bend it around the opening of a bag to keep the contents inside
- unroll it and stick several pieces of food with it to have a “pincho moruno”
- heat it enough so that it melts and use it to stick small metallic things together
- cd/dvd tray opener
- unroll it, make it circular and use it for fleas to jump through in a flea circus
- if you have too many papers make a hole through them with a puncher, unroll the paper clip and make it pass through the hole to keep the pages together
- use it to keep old furniture doors that have small hooks together
- you can use it as a puncturing weapon
- hit it with your nails and if you have a sensitive ear you will have a percussion instrument
- it serves as a projectile
- a cheap belt for your pants if you don’t have a belt or if your pants’ buttons are off
- as a hook for those fishing days
- if it’s hollow and big you can use it to drive water to your plants
- unroll it, stick it into the sand on the beach and use it measure tides
- you can twist it and make letters or numbers to teach the alphabet (you can break it in parts with your hands to make some letters like A)
- unroll it and twist it and with adequate medical precautions you can use it as piercing or earring
- unroll it, put it in a small container and fill half of the container with, put it in the fridge and a few hours laters you will have a transparent pendant that you can hang from your ear
- unroll it and direct an orchestra with it (requires good eye sight)
- use it to clean small spaces like the spaces between the keys of your keyboard
- use it to drive current from one place to another
- if it’s tall enough unroll it, go to the Moon, attach a flag of your preferred country to it and stick it into the Moon surface
- if it’s made of bamboo and it’s big enough break it apart in straight pieces and you now have kung fu staffs
- unroll it and use it to clean obstructed and small openings
- unroll it, bend it on two sides with square angles and you now have a miniature football goal
- do the same but make the central area shorter and you now have a door for your flea circus
- twist like a “w” or a “m” and you will have a psychodelic earring
- you can twist it to draw a triangles, rectangles, squares, pentagons, hexagons…
- you can unroll it stick it in your table in front of you so that when you’re studying and your head is falling on top of the table you will wake up and continue studying
- you can break it into smaller straight parts, stick them all in a bland surface and have a miniature fakir bed
- you can make jokes about Clippy from Microsoft’s Office with it
- you can unroll it, bend it alternatively one way and then another at some points and curve the unrolled part between them to make a tunnel
- you can unroll it, stick a piece of paper with your wish written on it and hang it on a Japanese temple
- use it to strengthen the structure of a paper plane
- you can use it to draw anything on the sand
- if it’s made of diamond you can use it to draw on almost anything
- unroll it and use it to stir your martini
- if it’s big enough stick it on the roof of your house to attract lightnings
- if it’s big and wide enough unroll it, curve it and you have a water chute
- use it to signal places in the ground like the place where you buried your secret treasure in the Solomon Islands
- unroll it, make it semi circumpherence, wire it, place the wires underground, plant it on your secret islands near your base and connect it to an intrusion detection system so that when the enemy approaches and inadvertently triggers it you will know where he is
- unroll it, stick it into the top of a candle, incline the candle, light it up so that the part where you stack the paperclip in is lower, light up the candle and put the bare skin of a prisoner on the other side to torture him
- sell it to someone who hasn’t seen a paperclip before and make a fortune
- say that it was the paperclip the Office team used to create Clippy, sell it on eBay and make a fortune
- if big enough bend it so that it looks like an “L” and use it to sweep the sand out of your tropical bungalow’s entrance
- unroll it bend it and attach it to your dinner table to hold the table cloth in place
- if it’s made of the right material you can use it as part of antenna
- bend it carefully, put it inside the credit card slot of an ATM of the competition so that cards don’t completely fit and make their customers angry
- bend it and use it to scratch the part of your back that you don’t normally reach
- while in the original form bend one of the corners in a straight angle and use it to support books in a shelf
- use it to make a point in a blog post about divergent thinking and creativity
People that are broadly considered to have a genius mind can come up with 200 uses.
As Sir Ken mentions in the presentation the western education system is built on a rational and industrialized way that progressively forces us shut down our creativity as we go through the education ladder. Many of us end up considering creativity the privilege of artists, musicians and a few other gifted people when it really is something that we all have. Watch the whole video if you don’t believe me.
After doing the paperclip exercise I spent some time thinking about it and I found an interesting connection between these exercises and some raja yoga exercises. In some of those yogic exercises you are asked to think about a simple object like an apple, a wall or any other simple object and write as many ideas connected to them as possible. After you can’t come up with any new ideas, which at the beginning may be a low number, you move your attention away for some time and then later you focus on the initial object and try again. During that second time you will get more ideas than at the beginning and at the end you will be amazed at all the stuff that you knew about the object. It helps you to not only develop lateral thinking and creativity but to focus and gain will power. As you get better at it the yogic exercises suggest you to move up in abstraction and focus on ideas like love, truth, strength and other qualities and by doing so gaining new insights.
For more information:
Do you consider yourself creative? If so do you engage in creative or lateral thinking activities?