if ive a 1000 songs,using shuffle whats the probability, on average, how many tracks will be played before a previous song plays again.
tricky probability Q, getting a few different answers, with some variation of accuracy!!
thanks
pjh-10 0 Light Poster
Recommended Answers
Jump to PostNow that I've gone back to look at my equation, I realise that this is just the "Birthday Paradox" with a year of 1000 days, so to speak :)
Wikipedia has a good explanation and a number of equations that come out with the answer I got earlier, which is …
Jump to PostWhup. Answered (and coded) the wrong question after all. I stand corrected. 1+39. Cheers, Nezachem.
These are two completely different questions.
Pffft. They're hardly completely different. :)
Jump to Post1) What is the value of x at line 11?
1-2// not really sure,For the first question, your "answer" is absolutely correct! x is an automatic int variable. Automatic variables have scope from the time they are defined or declared until the end of the block in which they …
Jump to PostAll your prof wants of you is that you compute the function given here for M = 1000. It requires a loop and a few basic math operations.
So much ink has been …
Jump to PostThe
M_PI
is not standard but appears in many compilers. That is just the pi constant, so you can create your own constantconst double pi = 3.14159;
and substitutepi
for theM_PI
in the code.To be standard, the time function appears in
#include <ctime>
and should be …
All 77 Replies
deceptikon 1,790 Code Sniper Team Colleague Featured Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
histrungalot 32 Junior Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
Moschops 683 Practically a Master Poster Featured Poster
histrungalot 32 Junior Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Nathaniel10 34 Junior Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Nathaniel10 34 Junior Poster
Moschops 683 Practically a Master Poster Featured Poster
histrungalot 32 Junior Poster
Moschops 683 Practically a Master Poster Featured Poster
pjh-10 0 Light Poster
Moschops 683 Practically a Master Poster Featured Poster
Nathaniel10 34 Junior Poster
histrungalot 32 Junior Poster
Moschops 683 Practically a Master Poster Featured Poster
nezachem 616 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.