Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How many number of possibility ?

Subject: How many number of possibility ?

From: sam

Date: 8 Jan, 2013 23:47:11

Message: 1 of 6

Hello every one,

If we have 4 bit data, there are 4 possibility of one bit error in these 4 bit data

0 0 0 0
x 0 0 0
0 x 0 0
0 0 x 0
0 0 0 x

and there are 6 possibility of two bit error in these 4 bit data

0 0 0 0
x x 0 0
x 0 x 0
x 0 0 x
0 x x 0
0 x 0 x
0 0 x x

My question how many number of possibility of 6 bit error in 9 bit data ? Is there any rule of this number of probability ?


regards

Subject: How many number of possibility ?

From: Roger Stafford

Date: 9 Jan, 2013 03:33:11

Message: 2 of 6

"sam " <s_abcdf@yahoo.com> wrote in message <kcib5v$cfo$1@newscl01ah.mathworks.com>...
> My question how many number of possibility of 6 bit error in 9 bit data ? Is there any rule of this number of probability ?
- - - - - - - - - -
  There are 9C6 = (9!)/(6!)/(3!) = 84 ways. Matlab's 'nchoosek' function can generate all 84 of them for you. General formula: nCm = n!/m!/(n-m)!.

Roger Stafford

Subject: How many number of possibility ?

From: Roger Stafford

Date: 9 Jan, 2013 07:45:13

Message: 3 of 6

"Roger Stafford" wrote in message <kciodn$p3k$1@newscl01ah.mathworks.com>...
> "sam " <s_abcdf@yahoo.com> wrote in message <kcib5v$cfo$1@newscl01ah.mathworks.com>...
> > My question how many number of possibility of 6 bit error in 9 bit data ? Is there any rule of this number of probability ?
> - - - - - - - - - -
> There are 9C6 = (9!)/(6!)/(3!) = 84 ways. Matlab's 'nchoosek' function can generate all 84 of them for you. General formula: nCm = n!/m!/(n-m)!.
- - - - - - - - - -
  Here is how to use 'nchoosek' to generate all the possible 6-bit errors in 9-bit data (with a 1 representing an error):

 n = 9; k = 6;
 p = nchoosek(0:n-1,k);
 N = size(p,1);
 A = zeros(N,n);
 A(repmat((1:N)',k,1)+N*p(:)) = 1;

Roger Stafford

Subject: How many number of possibility ?

From: Jos (10584)

Date: 10 Jan, 2013 13:17:05

Message: 4 of 6

"Roger Stafford" wrote in message <kcj769$d6n$1@newscl01ah.mathworks.com>...
> "Roger Stafford" wrote in message <kciodn$p3k$1@newscl01ah.mathworks.com>...
> > "sam " <s_abcdf@yahoo.com> wrote in message <kcib5v$cfo$1@newscl01ah.mathworks.com>...
> > > My question how many number of possibility of 6 bit error in 9 bit data ? Is there any rule of this number of probability ?
> > - - - - - - - - - -
> > There are 9C6 = (9!)/(6!)/(3!) = 84 ways. Matlab's 'nchoosek' function can generate all 84 of them for you. General formula: nCm = n!/m!/(n-m)!.
> - - - - - - - - - -
> Here is how to use 'nchoosek' to generate all the possible 6-bit errors in 9-bit data (with a 1 representing an error):
>
> n = 9; k = 6;
> p = nchoosek(0:n-1,k);
> N = size(p,1);
> A = zeros(N,n);
> A(repmat((1:N)',k,1)+N*p(:)) = 1;
>
> Roger Stafford

You might be interested in my PERMPOS function which avoids the loops and recursiveness of nchoosek

http://www.mathworks.com/matlabcentral/fileexchange/11216

>>permpos(6,9)

ans =

     1 1 1 1 1 1 0 0 0
     1 1 1 1 1 0 1 0 0
     1 1 1 1 1 0 0 1 0
  ...
     0 0 1 1 0 1 1 1 1
     0 0 1 0 1 1 1 1 1
     0 0 0 1 1 1 1 1 1

~ Jos

Subject: How many number of possibility ?

From: Bruno Luong

Date: 10 Jan, 2013 13:41:08

Message: 5 of 6

"Jos (10584)" wrote in message <kcmf0h$gnf$1@newscl01ah.mathworks.com>...

> You might be interested in my PERMPOS function which avoids the loops and recursiveness of nchoosek
>
> http://www.mathworks.com/matlabcentral/fileexchange/11216

But this statement is found in this FEX:

ind = nchoosek(1:N,M) ; % create a list of all possible column indices

What about it?

Bruno

Subject: How many number of possibility ?

From: Jos (10584)

Date: 10 Jan, 2013 14:28:08

Message: 6 of 6

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <kcmgdk$lq3$1@newscl01ah.mathworks.com>...
> "Jos (10584)" wrote in message <kcmf0h$gnf$1@newscl01ah.mathworks.com>...
>
> > You might be interested in my PERMPOS function which avoids the loops and recursiveness of nchoosek
> >
> > http://www.mathworks.com/matlabcentral/fileexchange/11216
>
> But this statement is found in this FEX:
>
> ind = nchoosek(1:N,M) ; % create a list of all possible column indices
>
> What about it?
>
> Bruno

Oops. You're right of course, Bruno. It is indeed only a wrapper for Roger's code.

~ Jos

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us