background preloader

Combinations and Permutations

Combinations and Permutations
What's the Difference? In English we use the word "combination" loosely, without thinking if the order of things is important. In other words: So, in Mathematics we use more precise language: In other words: A Permutation is an ordered Combination. Permutations There are basically two types of permutation: Repetition is Allowed: such as the lock above. 1. These are the easiest to calculate. When we have n things to choose from ... we have n choices each time! When choosing r of them, the permutations are: n × n × ... (In other words, there are n possibilities for the first choice, THEN there are n possibilites for the second choice, and so on, multplying each time.) Which is easier to write down using an exponent of r: n × n × ... Example: in the lock above, there are 10 numbers to choose from (0,1,...9) and we choose 3 of them: 10 × 10 × ... (3 times) = 103 = 1,000 permutations So, the formula is simply: 2. In this case, we have to reduce the number of available choices each time. Do you see? 1. 2.

Free Online Version of Core Servlets and JavaServer Pages (Second Edition) in PDF Top 10 Cloud Computing Startups in Boston Depending on who you talk to, cloud computing is either one of the most significant technology transformation since the advent of the world wide web, or one of the most over-hyped fads since virtual reality. For today’s post, I thought I’d do a round up of the top cloud computing startups in the Boston area. But first, a confession: classifying a company as in or out of the cloud computing market is subjective. It reminds me of classifying Internet companies back in the mid-1990s (does having a web site make you an Internet company?), and is further complicated by the fact companies are scrambling to re-brand themselves with the cloud. If you haven’t noticed, Salesforce.com is now known as “the enterprise cloud computing company”, and Akamai is “the leading provider of cloud optimization services." So I have adopted a simple rule of thumb: if you think you’re a cloud company, then for the purposes of this top 10 list, I’m going to call you a cloud company. Conclusions

Dynamic Programming Practice Problems This site contains an old collection of practice dynamic programming problems and their animated solutions that I put together many years ago while serving as a TA for the undergraduate algorithms course at MIT. I am keeping it around since it seems to have attracted a reasonable following on the web. Eventually, this animated material will be updated and incorporated into an algorithms textbook I am writing. -- Brian Dean To view the solution to one of the problems below, click on its title. Problems: Maximum Value Contiguous Subsequence.

Dynamic Programming Archives - GeeksforGeeks A Derangement is a permutation of n elements, such that no element appears in its original position. For example, a derangement of {0, 1, 2, 3} is {2, 3, 1, 0}. Given a number n, find total number of Derangements of a set of n elements. Examples: Input: n = 2 Output: 1 For two… Read More » Given a “m x n” matrix, count number of paths to reach bottom right from top left with maximum k turns allowed. What is a turn? Given a matrix where every cell has some number of coins. Given an array of numbers and a constant k, minimize size of array with following rules for removing elements. Given a linear equation of n variables, find number of non-negative integer solutions of it. Given a n*n matrix where numbers all numbers are distinct and are distributed from range 1 to n2, find the maximum length path (starting from any cell) such that all cells along the path are increasing order with a difference of 1. Consider the below problems statement. Given a string consisting of only A’s and B’s.

Why You Should Never Use MongoDB « Sarah Mei Disclaimer: I do not build database engines. I build web applications. I run 4-6 different projects every year, so I build a lot of web applications. I’ve picked the wrong one a few times. The project Diaspora is a distributed social network with a long history. But they hit a nerve. Diaspora was the first Kickstarter project to vastly overrun its goal. As a result of their Kickstarter success, the guys left school and came out to San Francisco to start writing code. They ended up staying at Pivotal for more than two years. That’s a lot of buzzwords. “Distributed social network” If you’ve seen the Social Network, you know everything you need to know about Facebook. A screenshot of the Diaspora user interface There’s a feed in the middle showing all your friends’ posts, and some other random stuff along the sides that no one has ever looked at. The Diaspora infrastructure is not located behind a single web address. Pods of different sizes communicate with each other, without a central hub.

How This Web Site Uses MongoDB Warning: this post is intended for developers. It gets a bit technical! Sometimes I'm asked what platform we're running the Business Insider on. Well, we're using LAMP, of course: Linux, Apache, Mongo, PHP. After I get past defending our choice of PHP to the haters (you know who you are!) So what's Mongo? MongoDB is an open-source, non-relational database that combines three key qualities: scalable, schemaless, and queryable. Mongo's design trades off a few traditional features of databases (notably joins and transactions) in order to achieve much better performance. So Mongo occupies a sweet spot for powering web apps. Full disclosure: TBI and 10gen, the developers of MongoDB, share certain investors and board members. Here's why and how we use it: It's Scalable TBI gets fairly high traffic, and we're growing quickly. When we do eventually need to scale up further, Mongo has automatic sharding features to distribute data and load across multiple boxes. Document-oriented, not relational

13 Highly Useful Free Programs and Websites That Any LifeHacker Must Try There’s plenty of useful free computer programs and websites that a lot of people don’t know about. Hopefully, after reading this post, your time spent in front of the computer will become a bit more healthy, productive, and easily managed. 1. VidtoMP3 VidtoMP3 helps you convert YouTube videos into mp3s for you to play on your computer. All you need to do is to insert the youtube link into the text box, wait for it to convert, and you’re set to download the audio. Easy as pie. 2. f.lux You know how you’re not supposed to sit in front of LED screens and expose yourself to blue light at night if you want to sleep well? f.lux can help with that. I’ve been using f.lux for over a year and I really recommend it. 3. RescueTime sends you weekly reports on how you’ve spent your time by the computer. You can personally adjust what kind of activities you want RescueTime to consider productive or distractive. 4. Just click the Boomerang box and set the date and it’ll be scheduled automatically. 5. 6. 7.

The 20 Startups Marissa Mayer Has Acquired at Yahoo Yahoo acquired app maker Lexity on Wednesday, the company's 20th since Marissa Mayer became CEO of Yahoo a little more than a year ago. Twenty startups is no small number, especially when you consider that in just 13 months, the 18-year-old company has boosted its acquisition count by nearly a quarter. The majority of these acquisitions have been small — five were purchased for only $16 million together — and were more often for talent than specific products. Generally speaking, Mayer has sought out companies that have built promising, if unsuccessful, consumer-facing mobile apps. In a few cases, the acquisitions were for more than talent. Here's a look back at the 20 startups Mayer has acquired so far during her tenure at Yahoo: The List 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. What's Next Yahoo still has plenty of cash to spend on acquisitions — $4.8 billion as of the end of June. The company has built up a solid base of mobile engineering talent to date.

shell - What are your favorite command line features or tricks? Ten Best Zoos in the United States - plainadventure.com Karen and I love to go to zoo’s, especially well done zoo’s. To read about all the zoos that we have visited you can click here. This list contains the top ten zoo’s that we think are the best in the United States. Some of these zoo’s Karen and I have been to, others are ones that we want to see. Our ten best zoo’s is based on looking at their website, reviews, and one of our favorite zoo books called America’s Best Zoos: A Travel Guide for Fans & Families by Allen W. Ten Best Zoos in the United States 10. via The Saint Louis Zoo is located in Forest Park has 90 acres to house 655 species of animals. Check out their website at 9. via The Minnesota Zoo is located about 15 miles south of the Twin Cities in Apple Valley. Check out their website at 8. via The Denver Zoo is an 80 acre zoo located in the heart of Denver at historic City Park. Check out their website at 7. via Check out their website at

List of 10 Best Rated Zoos in America in 2014 | World Traveling Blog If you are living in US and animal lovers, you may find best rated zoos in America in 2014 for family visits including kids. I include this list to help you find number one place for getting zoo experience for seeing interesting native animals and relaxing times as recommended activities on vacation. Here are top 10 zoos in US as popular attraction by among Americans to search related information on Internet in 2013. It could be recommended choice in 2014 due to having authentic habitats, safari parks, and cool aquariums. You also can read best way to visit Grand Canyon from Las Vegas. 10. Considered as non-profit zoo in US, it is claimed as Phoenix Point of Provide because it provides 1400 animals and large walking trails. 9. Located in Centennial District of Philadelphia, Pennsylvania, it is considered as first zoo in America. 8. Located in Omaha, Nebraska, it is known as place for animal conservation and research as well for education and recreations. 7. 6. 5. 4. 3. 2. 1. Like this:

Henry Vilas Zoo : Home Page Back to Busch Gardens Jenny and I enjoyed a brief trip to Florida this past weekend, attending to family business and spending time with good friends. Among the highlights of this adventure was a day spent at Busch Gardens. This was my first visit to the park in over 20 years, and I was amazed by how much the place has changed. Expanding from its humble beginnings as a garden and zoo tacked onto a brewery, Busch Gardens has struggled to compete with nearby Disneyworld. The fact that the park charges Disney-like prices probably doesn't help matters. Back then, Busch Gardens borrowed liberally from colonial-era "Dark Continent" language and imagery. Busch Gardens has changed a great deal over the past couple decades, now attracting guests with increasingly spine-bending rides, ritzy performances, holiday themes, and pop culture tie-ins. No matter how much the park has changed, Busch Gardens delivers plenty of jaw-dropping encounters with the natural world.

Related: