|
|||||
|
|
#1 |
|
|
(i) The sum is even, (ii) The sum exceeds 9. Given that the faces appearing are different |
|
|
#2 |
|
|
> A pair of dice is tossed, find the probability of > (i) The sum is even, > (ii) The sum exceeds 9. > Given that the faces appearing are different Looks like homework (best done by you) and does not look like programming so comp.programming is an odd place to post. -- Ben. |
|
|
#3 |
|
|
> A pair of dice is tossed, find the probability of > (i) The sum is even, > (ii) The sum exceeds 9. > Given that the faces appearing are different It would be better to post this on the math group, sci.math, instead. This is for discussing programming computers, not math questions with no relevance to that. |
|
|
#4 |
|
|
On Sat, 16 Jun 2007 09:26:27 -0700, King imran <imran6286@gmail.com>
wrote: >A pair of dice is tossed, find the probability of >(i) The sum is even, >(ii) The sum exceeds 9. >Given that the faces appearing are different My two dice have 4 faces each and are marked 10, 12, 14, 16 and 20, 20, 20, 20 respectively. (i) 100% (ii) 100% Now just let me have your instructor's e-mail address and I can send in your homework for you. rossum |
|
|
#5 |
|
|
King imran <imran6286@gmail.com> writes:
> A pair of dice is tossed, find the probability of > (i) The sum is even, > (ii) The sum exceeds 9. > Given that the faces appearing are different (loop :with tries = 1000000 :repeat tries :for dice-1 = (1+ (random 6)) :for dice-2 = (1+ (random 6)) :when (and (/= dice-1 dice-2) (evenp (+ dice-1 dice-2))) :sum 1 :into evens :when (and (/= dice-1 dice-2) (< 9 (+ dice-1 dice-2))) :sum 1 :into exceeds :finally (return (list (/ evens tries) (/ exceeds tries)))) --> (166381/500000 111237/1000000) -- __Pascal Bourguignon__ http://www.informatimago.com/ NOTE: The most fundamental particles in this product are held together by a "gluing" force about which little is currently known and whose adhesive power can therefore not be permanently guaranteed. |
|
|
#6 |
|
|
King imran said:
> A pair of dice is tossed, find the probability of > (i) The sum is even, The probability is 1. A pair is two, so there are two dice, and two is even. > (ii) The sum exceeds 9. The probability is 0. There are only two dice. Two is less than nine. > Given that the faces appearing are different That doesn't affect the sum at all. There are still only two dice. -- Richard Heathfield "Usenet is a strange place" - dmr 29/7/1999 http://www.cpax.org.uk email: rjh at the above domain, - www. |
|
|
#7 |
|
|
Pascal Bourguignon <pjb@informatimago.com> writes:
> King imran <imran6286@gmail.com> writes: > >> A pair of dice is tossed, find the probability of >> (i) The sum is even, >> (ii) The sum exceeds 9. >> Given that the faces appearing are different > > (loop > :with tries = 1000000 > :repeat tries > :for dice-1 = (1+ (random 6)) > :for dice-2 = (1+ (random 6)) > :when (and (/= dice-1 dice-2) (evenp (+ dice-1 dice-2))) :sum 1 :into evens > :when (and (/= dice-1 dice-2) (< 9 (+ dice-1 dice-2))) :sum 1 :into exceeds > :finally (return (list (/ evens tries) (/ exceeds tries)))) > --> (166381/500000 111237/1000000) That's working too hard. Just try all the possibilities. There are only 36, ***uming conventional 6-sided dice. -- Ben Pfaff http://benpfaff.org |
|
|
#8 |
|
|
Ben Pfaff <blp@cs.stanford.edu> writes:
> Pascal Bourguignon <pjb@informatimago.com> writes: > >> King imran <imran6286@gmail.com> writes: >> >>> A pair of dice is tossed, find the probability of >>> (i) The sum is even, >>> (ii) The sum exceeds 9. >>> Given that the faces appearing are different >> >> (loop >> :with tries = 1000000 >> :repeat tries >> :for dice-1 = (1+ (random 6)) >> :for dice-2 = (1+ (random 6)) >> :when (and (/= dice-1 dice-2) (evenp (+ dice-1 dice-2))) :sum 1 :into evens >> :when (and (/= dice-1 dice-2) (< 9 (+ dice-1 dice-2))) :sum 1 :into exceeds >> :finally (return (list (/ evens tries) (/ exceeds tries)))) >> --> (166381/500000 111237/1000000) > > That's working too hard. Yes, but that's thinking less, an obvious objective of the OP :-) > Just try all the possibilities. There > are only 36, ***uming conventional 6-sided dice. > -- > Ben Pfaff > http://benpfaff.org -- __Pascal Bourguignon__ http://www.informatimago.com/ NOTE: The most fundamental particles in this product are held together by a "gluing" force about which little is currently known and whose adhesive power can therefore not be permanently guaranteed. |
|
|
#9 |
|
|
"Pascal Bourguignon" <pjb@informatimago.com> wrote in message news:877iq3joy8.fsf@thal***a.lan.informatimago.com ... > Ben Pfaff <blp@cs.stanford.edu> writes: > >> Pascal Bourguignon <pjb@informatimago.com> writes: >> >>> King imran <imran6286@gmail.com> writes: >>> >>>> A pair of dice is tossed, find the probability of >>>> (i) The sum is even, >>>> (ii) The sum exceeds 9. >>>> Given that the faces appearing are different >>> >>> (loop >>> :with tries = 1000000 >>> :repeat tries >>> :for dice-1 = (1+ (random 6)) >>> :for dice-2 = (1+ (random 6)) >>> :when (and (/= dice-1 dice-2) (evenp (+ dice-1 dice-2))) :sum 1 :into >>> evens >>> :when (and (/= dice-1 dice-2) (< 9 (+ dice-1 dice-2))) :sum 1 :into >>> exceeds >>> :finally (return (list (/ evens tries) (/ exceeds tries)))) >>> --> (166381/500000 111237/1000000) >> >> That's working too hard. > > Yes, but that's thinking less, an obvious objective of the OP :-) > > >> Just try all the possibilities. There >> are only 36, ***uming conventional 6-sided dice. But you are ***uming the intent of the homework. Possibly the intent was to write a program that enumerates the possibilities and then counts which of them meet the criteria. Of course there were no specifications on the dice (or a statement that all rolls are equally probable) so any answer would be speculative. |
|
|
#10 |
|
|
"Barry" writes:
> "Pascal Bourguignon" <pjb@informatimago.com> wrote in message >>> Just try all the possibilities. There >>> are only 36, ***uming conventional 6-sided dice. > > But you are ***uming the intent of the homework. Possibly the intent > was to write a program that enumerates the possibilities and then counts > which of them meet the criteria. Of course there were no specifications > on the dice (or a statement that all rolls are equally probable) > so any answer would be speculative. The original question was about "a pair of dice". Most reasonable people would ***ume that the subject was an ordinary pair of dice. Just as a question containing "The man ran" would imply it was a one-headed man with two legs. I would hope that the OP has learned his lesson, do not post questions to a group of programmers, except as a last resort. . There was nothing in the OP's post to indicate that a program was involved in any way. And, indeed, a program would be about the worst possible way to answer the question. Questions that can be solved analytically should be solved that way, a simulation program is a last resort when nothing else works. |