Question

Permutations in Excel

Asked by: hawkeye_zzz

I need a formula for permutations/Odds. Ideally a grid to enter numbers in.
The problem is:
There are 10 wines, from 10 countries, and you're given 6 and have to guess which countries they are from.
What are the odds of getting 6 out of 6 guesses right (in any order)?
what are the odds of getting 5 out of 6 (and 4 out of 6, and 3 out of six, and 2 out of 6 and 1 out of 6) right (in any order)?
results in the form "1 in x chance"

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-10-16 at 01:45:12ID24817457
Tags

lottery

,

permutations

,

odds

Topic

Microsoft Excel Spreadsheet Software

Participating Experts
3
Points
500
Comments
22

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. r-permutation
    I need an algorithm that will generate, in lexicographic order, permutations of 'k' letters from 'n' objects. e.g. 6 letters from an alphabet of 26 abcdef abcdeg abcdeh . abcdez abcdfe . abcdze etc. Does anyone have access to a source?
  2. Permutation
    Hi, I need one routine for permutation in my project as follows. I want 3 number combination from 1 to 15 numbers. Each combination should be put in a file, one combination per line as follows(comma seperated), 1,2,3 1,9,15 . . . I want all the combinations. Experts,...
  3. Permutation with smaller numbers
    I need a program to find permutations with m of n different numbers. For example numbers are 1,2,3,4,5 and permutations are 12,13,14,15, 21,23,24,25, 31,32,34,35.... (20 permutations) Thanks
  4. Is there a formula in EXCEL that displays permutations
    If I have the 9 letters A B C D E F G H I I know that there are 9*8*7 = 504 permutations of 3 letters. For example, ABC, ABD, ABE........IHG. Is there someting in EXCEL that can be done so that all of these permutations are automaticlly displayed, preferable down the page w...
  5. Permutation in array
    I have an array size n, filled with double values. I want to make some mathematical calculations (queue) and i have to get all posible combinations of elements in array. Something like this: for (int i=0; i<array.length;i++) { for (int j=0; j<array.length;j++)...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: chris_bottomleyPosted on 2009-10-16 at 02:08:41ID: 25587849

Hello hawkeye_zzz,

Try combin.

Enter the number of input and th enumber of selections and you get the number of permutations.  i.e.

=combin(10,6) returns 210
i.e. 1 chance in 210 to randomly select the correct answers

Regards,

chris_bottomley

 

by: brettdjPosted on 2009-10-16 at 02:09:06ID: 25587853

The odd of 6/6 =
COMBIN(6,6)*(1/10)^6*(9/10)^0
= 1,000,000 to 1

5 in 6
=COMBIN(6,5)*(1/10)56*(9/10)^1
=18,519 to 1

see attached file

Cheers
Dave




 

by: chris_bottomleyPosted on 2009-10-16 at 02:11:31ID: 25587866

See as attached ... first row is the number of inputs and the column A through ... is the number of selections

Chris

 

by: brettdjPosted on 2009-10-16 at 02:12:03ID: 25587872

file attached this time ....

so N from  6 is

= COMBIN(6,N) * (1/10)^n*(9/10)^(6-n)

in total the 7 probabilities (0,1,2,3,4,5,6 correct) add up to 100%
Cheers
Dave

 

by: brettdjPosted on 2009-10-16 at 02:15:53ID: 25587896

Chris,

It's correct that there are 210 ways to pick 6 bottles from 10 - order unimportant

But in this case it's how many correct guesses at random from those 6 bottles, with a 1/10 chance that any particular random guess is correct, 9/10 that is is wrong

Cheers

Dave

 

by: chris_bottomleyPosted on 2009-10-16 at 02:20:10ID: 25587909

Agreed that i'm wrong ... mind stuck on winning the lottery!

Chris

 

by: brettdjPosted on 2009-10-16 at 02:27:29ID: 25587942

<slightly off topic - Hawkeye, I thought your name was familiar   http://www.experts-exchange.com/Q_20810477.html  :) >

 

by: hawkeye_zzzPosted on 2009-10-16 at 03:24:12ID: 25588154

Brett, I'd completely forgotten about that one - one bored night playing with numbers :)


I had got the figure of 210 (6 out of 10, any order), there's a handy online calculator for that:
http://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html
And I can recreate that in excel as suggested: combin(10,6) or more fundamentally: (10*9*8*7*6*5)/(6*5*4*3*2*1) - one number per cell, =product(A1:A6)/product(B1:B6)
which works well for any variety of "Choose x from y, any order"

However that says you have 6 choices and you get 6 right.
What I can't get (I don't think anyone's given it yet) is if you have 6 choices (with 10 to choose from) and only have to get 5 right. (3 variables)
I tried just deleting the 5, and the 6 and the 7 from the top row, but that gave a result that said you have a 1 in 1 chance of being right if you have to get 3 out of your 6 correct. This must be wrong, as with 6 choices and 10 wines, you could feasibly choose 4 wrong ones and only 2 correct ones. You couldn't get worse than 2 right, so the odds of getting 2 out of your 6 right is 1 in 1.


 

by: brettdjPosted on 2009-10-16 at 03:34:22ID: 25588198

It was agood one :)

Did you open my file in this question?

The chance of picking 5 bottles out of 6 correctly, with 10 options for each bottle (ie you make all choices without feedback as to your initial choice being right or wrong) is 1 in 18,519

Lets take a more simple example

You need to pick two bottles correctly. The outcomes are 0 correct picks, 1 correct pick and 2 correct picks

0 picks (bottle 1 wrong, bottle 2 wrong)  = (9/10)*(9/10) = 81%  [or COMBIN(2,0)*(1/10)^0*(9/10)^2]
1 pick (bottle 1 right bottle two wrong + bottle one wrong + bottle two right) = (9/10)*(1/10) + (1/10)*(9/10) = 18% [or COMBIN(2,1)*(1/10)^1*(9/10)^10]
2 picks (bottle 1 right, bottle 2 right)  = (1/10)*(1/10) = 1%  [or COMBIN(2,2)*(1/10)^2*(9/10)^0]


Cheers
Dave

 

by: hawkeye_zzzPosted on 2009-10-16 at 03:39:59ID: 25588225

That's with the right order,
What I'm looking for is "any order" so 6/6 will be 1 in 210, and 2/6 will be 1 in 1, and 3, 4 or 5/6 will be somewhere between those two

 

by: brettdjPosted on 2009-10-16 at 03:55:56ID: 25588291

We have crossed wires on the intent of your question - or better put, I misunderstood

There are 210 ways of picking 6 bottles out of 10. So far so good

My initial "solution" was aimed at getting every single one of these 6 bottles individually correct.  From your post above I now understand that you aren't worried about getting the individual bottles right, its the chances of having  mathing countries somewhere within your selected 6 bottles. as you say there are only 5 possible outcome - I'll rerun the calcs on this basis

 

by: barryhoudiniPosted on 2009-10-16 at 03:56:19ID: 25588296

The chances (out of 210) of getting n right is

=COMBIN(6,n)*(combin(10-6,n)

so for n =6 that will give you 1

for n=5 that will give you 24.....then 90 for 4, 80 for 3 and 15 for 2, giving a total of 210

It's not possible to get 1 or 0 right with 6 out of 10

regards, barry

 

by: barryhoudiniPosted on 2009-10-16 at 04:01:05ID: 25588321

Obviously those numbers I gave are the exact numbers of 6,5,4,3,or 2 correct so to get the number with at least 4 right, for instance, you'd add the exact numbers for 4 5 and 6, i.e.

90+24+1

so you have 115/210 = 54.8% chance of at least 4 correct

regards, barry

 

by: barryhoudiniPosted on 2009-10-16 at 04:07:20ID: 25588354

Sorry...I still managed to get the generic equation wrong, the number of instannces (out of 210) of n correct are

=COMBIN(6,n-6)*combin(10-6,n-6)

so, for instance, if n = 5

=COMBIN(6,1)*combin(10-6,1)=24

regards, barry

 

by: brettdjPosted on 2009-10-16 at 04:11:34ID: 25588375

nicely done Barry :)

Although I'm still curious on the actual question ..... Wouldn't the aim of the quiz be to get the actual bottles right bottle by bottle, rather than somewhere in the selected collection (ie the Australian wine would hate to be called UK wine even if they both were in the selected 6) . Intuitively that doesn't sound skill based :)

 

by: barryhoudiniPosted on 2009-10-16 at 05:16:21ID: 25588751

I suppose it's more of a lottery based question rather than a wine-based one?

I hope you can work that out from my posts, hawkeye, I would attach a worksheet but I'm unable to do that right now. IF you want I can attach a generic version which would do the calculations for any x bottles from y

regards, barry

 

by: hawkeye_zzzPosted on 2009-10-16 at 05:38:37ID: 25588900

Good question, Dave, I'll ask the boss!
It's for the wine show in London next week, so anyone who's close can come and see the probability in action and have a drink too!


Barry, that sounds good, but first of all the formula is slightly back to front. In combin(x,y), x must be bigger than y. But if you put 5 into your formula above (ID ..354), you get a negative in the first part, and a #num! in the second.
I think it should read: =COMBIN(6,6-n)*combin(10-6,6-n), which gives the results you quote above.

This sounds good, where n=2, it gives odds of 1 in 15 (as you've said above, and as per attached file). But the odds of choosing 2 correct with 6 to choose, and 10 choices, is 100%. So either the formula is flawed or I've misinterpreted that 15 figure.... what do you think?

 

by: barryhoudiniPosted on 2009-10-16 at 06:18:03ID: 25589183

Sorry, hawkeye, two goes at that formula and I still didn't give you the correct one......as you say it should be

=COMBIN(6,6-n)*COMBIN(10-6,6-n)

15 is the number of combinations (out of the 210 possible combinations) where exactly 2 would match, that was what I was referring to in post (ID..321) above.

So the numbers of exact matches for 6,5,4,3 and 2 are 1, 24, 90, 80 and 15 respectively but for a cumulative figure representing at least 6, at least 5, at least 4 etc. you'd get the cumulative sums of those, i.e. 1, 25, 115, 195 and 210 or as percentages of 210

Exactly 6 - 0.48%
At least 5 - 11.90%
At least 4 - 54.76%
At least 3 - 92.86%
At least 2 - 100%

I've got a worksheet which shows those calculation quite succinctly but EE isn't letting me attach anything right now, I expect I can do that later....

regards, barry

 

 

by: barryhoudiniPosted on 2009-10-16 at 06:22:28ID: 25589220

To get those figures in your sheet then use this formula in F12

=SUM(E$12:E12)

and copy down to F16

and then in G12 copied down to G16

=F12/SUM(E$12:E$16)

format as %

regards, barry

 

by: hawkeye_zzzPosted on 2009-10-16 at 08:04:41ID: 25590238

That's ideal. But does it make sense?
What we're doing is multiplying the chance of getting the ones you choose right by the chance of getting the ones you don't choose right? but you don't choose the ones you don't choose, so why do we include probability for something that is not happening?

That may be a philosophical question, and you don't have to answer it for the points, just curious.

Charlie

 

by: barryhoudiniPosted on 2009-10-16 at 08:21:04ID: 25590378

Hello Charlie

This is the way I looked at it:
 
Consider the situation where you get 5 right out of 6, how many possible combinations are there for that?
 
If you get 5 right then you only have 1 correct country missing, so there are 6 possibilities, each one of the correct 6 missing
 
now for each of those 6 possibilities there must be a replacement (wrong) country. There are 4 of those so for each of the 6 missing correct countries there are 4 possible wrong countries which could replace it, therefore 6*4 = 24
 
Now for 4 right the same logic applies&..there are 2 correct countries missing out of 6 so thats 15 possibilities&and there must be 2 replacement wrong countries, any 2 out of 4 = 6, 6*15=90
 
Mathematically of course you get the number for the correct countries missing with
 
=COMBIN(6,6-n)
 
and the number for the combinations of replacements with
 
=COMBIN(10-6,6-n)
 
and the result is those 2 multiplied together.
 
Perhaps there are other ways&&..but I dont know of any
 
regards, barry

 

by: hawkeye_zzzPosted on 2009-10-16 at 11:49:15ID: 25592225

Thanks guys, that's brilliant
Charlie

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...