[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating container with elements
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Creating container with elements |
Date: |
Tue, 10 Apr 2012 14:25:30 -0400 |
On 6 April 2012 15:17, trixfix <address@hidden> wrote:
> Container holds 1000 elements which 940 are 1 and 60 are 0. I need to
> randomly take 100 elements from that container and check how many 1 and 0 I
> have.
On Octave 3.6.0 or higher, sampling without replacement:
number_of_ones = nnz (randperm (1000,100) <= 940)
> Also i need to determine probability how many 1 are there, if more
> than 95 or more is 1.
doc hygecdf
HTH,
- Jordi G. H.