Borrar filtros
Borrar filtros

nchoosek help

3 visualizaciones (últimos 30 días)
Sean Smith
Sean Smith el 15 de Sept. de 2011
I am trying to figure out the nchoosek command but can't seem to get it. What I am trying to answer is if there are 4 people in a line, how many different ways can they be arranged. I tried nchoosek(1:4,4) but that returns the vector 1 2 3 4 and nchoosek(4,4) but that returns just a 1. What am I missing here?
  1 comentario
Sean Smith
Sean Smith el 15 de Sept. de 2011
from what i have been reading n is the number of things and k is the number you take at a time, so shouldn't it be 4 and 4 because there are 4 things and you take them 4 at a time?

Iniciar sesión para comentar.

Respuesta aceptada

Wayne King
Wayne King el 15 de Sept. de 2011
Hi Sean, 4 people in a line is just factorial(4). nchoosek assumes you are interested in how many ways you can choose a number of objects out of set where order is not important. Note that arrangement in a circle is different.
Wayne
  1 comentario
Sean Smith
Sean Smith el 15 de Sept. de 2011
well that makes total sense. thank you.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Graphics Object Programming en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by