k20057 5

15 Reputation

4 Badges

10 years, 330 days

MaplePrimes Activity


These are replies submitted by k20057 5

@Carl Love 

Maybe is not sample without replacement.

But I think the theory is right.

I want to regard  many same sequence as one.

The same sequence is the number equal,regardless the sort.

 

 

@Carl Love 

Yes.I check the dictionary that I know sample without replacement mean.

I want to do  sample without replacement statistics.

The two result is almost equal.

 

 

 

 

 

 

 

 

 

 

@Carl Love 

Thank you very much.

But I have another problem.

If I set R:= RandomCompositions(9,6):

 

9 is ahead 8.

 

Thank you very much.

I was sorry that I had not noticed you change module command  to proc.

@Carl Love 

I still have a aproblem.

[0, 0, 0, 0, 8, 0], [0, 0, 0, 0, 0, 8], [0, 0, 0, 0, 3, 5],[1, 1, 1, 1, 2, 2], [0, 1, 1, 1, 1, 4]

 

[0, 0, 0, 0, 8, 0], [0, 0, 0, 0, 0, 8]    I want the two random as one. 

And then the  sequence divide by 4 not 5.

statistics

0=10/4

1=8/4

2=2/4

3=1/4

4=1/4

5=1/4

8=1/4

@Carl Love 

Thanks very much.

@Carl Love 

Yes.

I want to check the answer of statistics. So I want to see the sequence.

ex:

[6, 2, 0, 0, 0, 0] [2, 4, 2, 0, 0, 0] [7, 1, 0, 0, 0, 0] [2, 0, 0, 2, 4, 0]  [4, 1, 1, 1, 0, 1]

0= 3

1=1

2=1

3=0

4=3/5

5=0

6=1/5

7=1/5

8=0

@Carl Love 

Thanks.

But I want to see the sequence of the statistics,I want to check the number summation.

Thanks again.

@Carl Love 

Thanks.

(8,0,0,0,0,0)  (0,8,0,0,0,0)  (0,0,8,0,0,0)  (0,0,0,8,0,0)  (0,0,0,0,8,0) (0,0,0,0,0,8)

If I want the six randoms  as one random.

 

 

@Carl Love 

I am a  novice. Your code is high-level  programming.I could't understand.

Could explain the mean of your code 

 Compositions:= [seq(C-~1, C= combinat:-composition(n+k, k))],
     Rand:= rand(1..nops(Compositions))
;
     ()-> Compositions[Rand()]

Thanks.


    

 

@Carl Love 

 

Thanks for your help.


The random selection from all 6-tuples of nonnegative integers whose sum is 8.

Yes, I want random selection repeatedly. 

 

The random selection finally become infinite loop.

 

1 2 Page 2 of 2