Robert Israel

6522 Reputation

21 Badges

18 years, 183 days
University of British Columbia
Associate Professor Emeritus
North York, Ontario, Canada

MaplePrimes Activity


These are replies submitted by Robert Israel

See also <http://oeis.org/A008918>

It is possible that somebody can help you.   What do you need help with?

Besides the code, it would be helpful if you told us what you were trying to accomplish with this.

@tatan2501 : actually it is a table, not an array.

@tatan2501 : actually it is a table, not an array.

I don't know what previous version you're referring to, but e was never a constant in Maple.  Before Maple V Release 4 (i.e. about 15 years ago) it was E.  Of course, you can always define

> e := exp(1);

and then you can use e as a constant.

@widmer : this sounds like a bug.  It should not happen that way.  Can you upload your worksheet?

@alex_01 :

OK, let's try again from the start.  
There are n candidates, who are presented in random order.   We're interested in selecting the best one.
The strategy we're considering is to reject the first k-1 candidates, and then accept the first candidate after that who is the best so far.  Suppose the best candidate is actually number b. 

Obviously if b < k we reject the best candidate, and the strategy fails.
On the other hand, if b >= k the strategy succeeds unless we accept somebody else before we get to the best candidate.  So, given that the best candidate is number b, we consider the best of the first b-1 candidates: say this is candidate number s.  Because the candidates are in random order, each of the b-1 possible values for s from 1 to b-1 are equally likely.  
If s < k, candidate s is rejected along with the rest of the first k-1 candidates, then candidates k to b-1 are rejected because they are worse than candidate s, and finally candidate b is accepted, so the strategy succeeds. 
If s >= k, then candidate s would be accepted, unless somebody else is accepted first; we don't get to candidate b, so the strategy fails.
Thus, given that the best candidate is in position b, the strategy succeeds if and only if s < k.  Since, as I said, each of the b-1 possible values for s are equally likely, and the k-1 values for s correspond to success, the probability of success, given that the best candidate is number b, is (k-1)/(b-1). 

@alex_01 :

OK, let's try again from the start.  
There are n candidates, who are presented in random order.   We're interested in selecting the best one.
The strategy we're considering is to reject the first k-1 candidates, and then accept the first candidate after that who is the best so far.  Suppose the best candidate is actually number b. 

Obviously if b < k we reject the best candidate, and the strategy fails.
On the other hand, if b >= k the strategy succeeds unless we accept somebody else before we get to the best candidate.  So, given that the best candidate is number b, we consider the best of the first b-1 candidates: say this is candidate number s.  Because the candidates are in random order, each of the b-1 possible values for s from 1 to b-1 are equally likely.  
If s < k, candidate s is rejected along with the rest of the first k-1 candidates, then candidates k to b-1 are rejected because they are worse than candidate s, and finally candidate b is accepted, so the strategy succeeds. 
If s >= k, then candidate s would be accepted, unless somebody else is accepted first; we don't get to candidate b, so the strategy fails.
Thus, given that the best candidate is in position b, the strategy succeeds if and only if s < k.  Since, as I said, each of the b-1 possible values for s are equally likely, and the k-1 values for s correspond to success, the probability of success, given that the best candidate is number b, is (k-1)/(b-1). 

hirnyk: You put the coordinates in the wrong order.

> with(plots):
implicitplot3d(exp(-(1/4)*(r-4)^2) = .6,r=0..6,phi=0..2*Pi,theta=0..Pi,coords=spherical,axes=box, transparency=0.9,  grid=[20,20,20], style=patchnogrid, lightmodel=light1);

 

hirnyk: You put the coordinates in the wrong order.

> with(plots):
implicitplot3d(exp(-(1/4)*(r-4)^2) = .6,r=0..6,phi=0..2*Pi,theta=0..Pi,coords=spherical,axes=box, transparency=0.9,  grid=[20,20,20], style=patchnogrid, lightmodel=light1);

 

@Christopher2222 : I think in Maple 12 plots is not a module, so can't be included in the uses statement.  Remove
plots from the uses statement, and replace display by plots[display], and I think it should work.

@Christopher2222 : I think in Maple 12 plots is not a module, so can't be included in the uses statement.  Remove
plots from the uses statement, and replace display by plots[display], and I think it should work.

@alex_01 : If there are b-1 possible values, all with equal probabilities, then the probability of each one is 1/(b-1).  If you consider a set of those values, the probability of the set is the sum of the probabilities of the members of the set.  So if your set has k-1 members, its probability is (k-1)/(b-1).  Is that clear enough?

@alex_01 : If there are b-1 possible values, all with equal probabilities, then the probability of each one is 1/(b-1).  If you consider a set of those values, the probability of the set is the sum of the probabilities of the members of the set.  So if your set has k-1 members, its probability is (k-1)/(b-1).  Is that clear enough?

First 18 19 20 21 22 23 24 Last Page 20 of 187