Welcome to Help4Web.co.uk - Web Design Help, Html Tutorial, Php, Asp , SQL help and CCNA, MCSE definitions!
Google
Webkpop-web.com

     Main Menu

· Home
· Free Downloads
· Computing FAQ
· Contact Us
· Free Software Downloads
· Tech Forum
· Technology News
· Web Design Help
· Web Links
· Your Online Account
· Your PM



     Web Browser


     Website Links
Supermediastore! #1 in Computer media & Accessory

White Papers IT
Learn Korean
Chinese Pop Music
Advertise Kpop
Korean Pop Site Map
Web Design
Pop Music
Chinese Girls
HK Pop Korean Music
Lee Hyori
Hyori
Boa Park Ji Yoon
Baby Vox YG Family
Jeon Ji Hyun
1 Tym Ha Ji Won
Shyne Rain Bi
Shin Mina SM Town
Fly to the Sky
Korean Girls and Models
Nicholas Tse
161 Clan
보아
Edison Chen
Sung Hi Lee
Shinhwa
Andy Lau Jay Chou
White Papers
Case Study SES
Kelly Chen
Liu Yi Fei Sammi Cheng
Jordan Chan Music
Computer Jobs IT

Computer Help Forum and Programming Advice :: View topic - A C++ Problem
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log inLog in 

A C++ Problem

 
Post new topic   Reply to topic    Computer Help Forum and Programming Advice Forum Index -> General Programming
View previous topic :: View next topic  
Author Message
Jon
Web Design Admin
Web Design Admin


Joined: Jul 12, 2004
Posts: 72

PostPosted: Sat Sep 04, 2004 1:00 am    Post subject: A C++ Problem Reply with quote

I am to developing this C program.Here's the question...

A commuter drives to work each morning. The route he takes each day includes eight stoplights. Most of the times, he has to stop for a red light at two of these stoplights and these stoplights are independent. What is the distribution for the number of times he must stop for a red light on his way to work? What is the probability that he does not have to stop for a red light? What if it is at most 5 times?

I mean..where do i have to start?..what function do i have to use? someone can guide me?? thanks..
_________________
Free MusicCpopServer Definition


Last edited by Jon on Sat Sep 04, 2004 1:20 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
ci5co
Web Design Newbie
Web Design Newbie


Joined: Aug 18, 2004
Posts: 89

PostPosted: Sat Sep 04, 2004 1:10 am    Post subject: Reply with quote

Since the events are mutually exclusive/independant the you can use a binomial distribution, this is A level maths which I just did the exam for. (Grabbing pencil and paper) This is probably too late for an answer but I can't resist the challenge of rembering maths from an exam I've done twice:

Let X be the number of times he must stop at a red light. The probability of stopping at a red light is 2/8.

Then X is binomially distributed, where the number of events is 8 and the probability of a success is 2/8.
Maths Notation: X ~ B (8, 2/Cool

Therefore the probability of (X = 0) = 8C0 x 2/8^0 x 6/8^8
i.e The probability of not hitting a red light to the power of the number of times, multiplied by the number of ways it can happen (8C0 = 1, all the same outcome can only be arranged once way)

The probability of (X < 6) = . Well this is where I look in the formula booklet which would have this probability listed... oddly it's not within an arms reach.

Anyway, to implement this in C I wouldn't be suprised if there was already some code to work with this kind of maths. Alternatively the only thing here which I would have put in a calculator is 8C0 which has it's own formula, something to do with factorials which you can find on the net.

Well that was a whole lotta fun and not a lot of help I suppose.
_________________
White Papers

Internet Marketing

Boku
Back to top
View user's profile Send private message Visit poster's website
Jon
Web Design Admin
Web Design Admin


Joined: Jul 12, 2004
Posts: 72

PostPosted: Sat Sep 04, 2004 1:11 am    Post subject: Reply with quote

Cool thanks for that
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Computer Help Forum and Programming Advice Forum Index -> General Programming All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum







Learn Chinese | Learn cantonese | Learn Mandarin | Grace Park | Party Organisers | Kaila yu | Phone Card | Twins | Chinese Society | Loans UK | BokuMaro | CV Help Book | Chinese Wife | Korean Singles | British Born Chinese | Bae Yong Jun | Speak Korean | Chinese Models | Music | Information Security Management | Maritime Greenwich Campus | Covering Letters Help | Chinese Music | Jang Nara | SES | YG Family | Learn Korean | Firewall Definition | Server Definition | Wireless Network Definition | E-Commerce Definition | Sales Leads | Application Firewall | CCNA definitions | Research Papers | Webcast | CV Help

Author KPop Music :- Jon Bock ( Chinese Pop Music Learn Korean )
Produced by Kpop-Web Design Associates, all rights not reserved.
Internet Marketing and Search Engine Optimisation Software Defined Radio