determining frequency

This is a discussion on determining frequency within the C Programming forums, part of the General Programming Boards category; hey all, I was wondering: I have two arrays both rolling dice ( rand()%6+1 ) for 6000 times and i ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    34

    determining frequency

    hey all,
    I was wondering:
    I have two arrays both rolling dice ( rand()%6+1 ) for 6000 times and i had the sums next to them in a column.... how would I:

    1) Determine the frequency of a number on the die
    (say 6, and wanting to know how many times it occured)

    2) Determine the proportion of total trials on which that number on the die came up (frequency/total trials) so that all the proportions add up to 1

    3)Construct a chart that prints the doubles of the arrays into order with double 6's at the top and double 1's at the bottom....

    Well im lost here and just need some guidance... thanks guys

  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    Post some attempted code and we'll gladly help you walk through it.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  3. #3
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    This is obviously a homework problem. Why don't you post what you've done or where you're are confused with a specfic concept and I'm sure someone will help you. For more guidence on this I suggest you read the Announcements, particuarly the scond one that talks about homework, or you can PM me. Good Luck.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Waaaaait a second. Wasn't this just posted by someone yesterday that was "work their friend gave them"? Kinda makes you wonder...

    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Yes it was, same user. I'm going to close this thread lakai02 because you got plenty of answers on the old one. Which is here:

    2nd day programming

    If you would like me to merge them or have any questions please PM me.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Determining CPU frequency
    By pgzh in forum Linux Programming
    Replies: 7
    Last Post: 03-17-2008, 10:34 AM
  2. I need to play a pre recorded vox file using C
    By m.sudhakar in forum C Programming
    Replies: 4
    Last Post: 11-17-2006, 05:59 PM
  3. Frequency density of spectrogra[ph/m]
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 12-29-2004, 02:48 AM
  4. Replies: 5
    Last Post: 11-20-2003, 12:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21