+ Reply to Thread
Results 1 to 11 of 11

calculating probability with unknown sample mean

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    edgewood, kentucky
    MS-Off Ver
    Excel 2003
    Posts
    2

    calculating probability with unknown sample mean

    25% of employees are minorities. random sample of 7 employees is selected.

    What is the probability that the sample contains exactly 4 minorities?
    Last edited by mikeyyohan; 01-25-2012 at 10:41 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: simple problem but drawing a blank

    I have an answer if you can figure out how to change your thread title to a problem. We really need you to be more specific on the thread title so we can find it again. You can't believe how many people have your EXACT title (If the forum would allow it.)

    Read the rules - change your title and I'll supply a possible answer. Fair?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    edgewood, kentucky
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: simple problem but drawing a blank

    fair. i think i did...

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculating probability with unknown sample mean

    Hi mikeyyohan and welcome to the forum and sorry about the rules.

    Find the attached workbook. I'm not sure why this is an Excel problem but here it is. In Col A I create 28 random numbers (they might be the same and this might be a problem).
    When you/I press F9 it recalculates and in C1 is a formula to count the number of numbers in Col A that are less than 8. I figured that 7 out of 28 was 25% based on your question.

    Then I wrote some VBA code that tallied up the number of times the number in C1 appeared. I keep that tally in column H.

    Here is the harder question. Does this random selection and code match the problem you have? The "with repeats" or "without repeats" keeps whispering in my ear. My code in Col A picks random numbers from 1 to 28 and their might be repeated (same) numbers. That may be different than the problem you have. If it is, let me know and I'll do it a different way.

    OK - Put the number of times you want to run calculate and tally the results in cell C4 and run the macro called RunRandCount. See what you get for an answer.

    Also - I sure hope 2003 Excel know the function RandBetween().
    Attached Files Attached Files

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: calculating probability with unknown sample mean

    For an exact answer, see Help for the BINOMDIST function.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculating probability with unknown sample mean

    I couldn't wait to give you the answer with no repeats. Here is a second workbook that is similar but the second table (starting in row 33) has no repeats of selecting people (numbers). The answers are completely different.

    You need to know if the "selecting random" allows selecting the same person a second time or not.

    Tell me again why this was an Excel problem?
    Attached Files Attached Files

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculating probability with unknown sample mean

    shg sent me back to school on his answer.

    I find a good explaination of BinomDist at http://growingknowing.com/GKStatsBoo...topic=Binomial.

    I'm not sure I understand it completely. I always want to do some (x + y)^n to figure these thing out using formulas. I'd rather write a little code and run it a bunch of times.

    Hey shg - do you have the answer to this problem using Binomdist so I can check it against my random code?

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: calculating probability with unknown sample mean

    Please Login or Register  to view this content.

  9. #9
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculating probability with unknown sample mean

    @shg - so if I read your chart above correctly then 5.77% of the time you would get exactly 4 minorities by selecting 7 employees at random.

    I really wish I could get that answer with my last sheet above. After running the macro and setting the counter to 100,000 random picks of 4 people out of 7 where 25% are minorities, I get the following numbers.

    Please Login or Register  to view this content.
    My answer is closer to 3.89% of the time. After another 100000 run I got 3.83%.
    Last edited by MarvinP; 01-26-2012 at 01:55 PM.

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: calculating probability with unknown sample mean

    I've not looked at your workbook, but a couple of comments.

    BINOMDIST assumes that each trial has the same probability of success, so it applies well to flipping a (biased or fair) coin, or in the present case, selecting a small sample from a large (infinite) number of employees.

    If you had only eight employees, and two were minorities, what are the chances if you pick a random sample of eight that two are minorities? Answer: 100%.

    Similarly, if you had 32 employees with 4 minorities, the odds are still significantly different:

    Please Login or Register  to view this content.
    Also (again, I've not looked at your workbook), you can't assign minority status with 25% probability to employees, because that would result in different percentages of minorities in each trial, which is not the question asked.

  11. #11
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: calculating probability with unknown sample mean

    Hi shg,

    I believe you are right but need to convince myself, no matter what you claim. I'd like to know why.

    I see in my code for sorting a line in the sort of ".Header = xlGuess". I wonder if it thinks there is a header sometimes and not others. This would throw my numbers off.

    I should clean up my attached workbook to show what I do but look at the second table (row 32 and down) to see the counters. I have numbers from 1 to 28 in col A. I do a Rand() in B and sort by B. This keeps the same people from being picked a second time (a problem in the top table). Then check to count the numbers in the first 7 spots (this is the 25%) that are less than 8. My model assumes numbers 1 to 7 are the minorities. I then tally the number of minorities found in the first 7 spots of 28 on column H.

    All the above makes sense to me. Now I have to see if xlGuess is doing the same thing each time.

    Edit - just set .xlGuess to .xlNo and got same results as my before tests.

    I guess it's time to go study....
    Last edited by MarvinP; 01-26-2012 at 03:14 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1