cual es la respuesta

2. Se tienen 15 libros distintos, de los cuales 3 son de matemáticas, 2 de física, 5 de informática y 5 de finanzas.
  1. ¿De cuántas formas podemos colocarlos en una estantería con un espacio vacío para 15 libros?
  2. ¿Cuáles son?
  3. ¿Y si queremos que los 5 de informática estén ubicados en los extremos?
  4. ¿Y si queremos que estén agrupados por materias?

2 Commenti

Walter Roberson
Walter Roberson il 26 Gen 2026
Approximate translation:
What is the answer?
2. You have 15 different books, of which 3 are math books, 2 are physics books, 5 are computer science books, and 5 are finance books.
In how many ways can you arrange them on a bookshelf with space for 15 books?
What are the ways?
What if you want the 5 computer science books to be placed at the ends?
What if you want them grouped by subject?
Walter Roberson
Walter Roberson il 26 Gen 2026
This a question about permutations and combinations, not about MATLAB.

Accedi per commentare.

Risposte (1)

Sam Chak
Sam Chak il 26 Gen 2026
Modificato: Sam Chak il 26 Gen 2026
I believe the mathematical puzzle involves the use of the factorial () operator. However, the factorial can rapidly grow to an exceptionally large value for relatively small integers n, which may make it challenging for students with ordinary math skills in permutations and combinations to verify the results. Nevertheless, you can test this approach using small numbers. But I haven't tested whether it truly works for very large numbers, as the formula may be purely coincidental for integers lesser than 4.
As for the last one, I don't know how to group the books by subject. What are your ideas?
% Total number of books
n = 3;
% Calculate total arrangements
total_arrangements = factorial(n);
disp(['Total arrangements of ', num2str(n), ' books: ', num2str(total_arrangements)]);
Total arrangements of 3 books: 6
% 1, 2, 3
% 1, 3, 2
% 2, 3, 1
% 2, 1, 3
% 3, 1, 2
% 3, 2, 1
% Number of computer science books
cs_books = 2;
% Calculate arrangements with CS books at the ends (on the right-hand side)
arrangements_with_cs_ends = factorial(cs_books) * factorial(n - cs_books);
disp(['Arrangements with ', num2str(cs_books), ' CS books at the ends: ', num2str(arrangements_with_cs_ends)]);
Arrangements with 2 CS books at the ends: 2
If Book 1 and Book 3 are CS books, only these arrangements are possible:
% 2, 3, 1
% 2, 1, 3

1 Commento

If the books of each type can be differentiated between, then the number of ways you can arrange them is
format long g
factorial(15)
ans =
1307674368000
if you were to list all of the arrangements, 5 to a line, then it would require
ans/5
ans =
261534873600
lines to list them, and it would require
ans * ((15+1)*4+15) / 2^30
ans =
19242.293214798
gigabytes of storage. It would then be completely impractical to list all of the arrangements.
The only way the question makes sense is if the books on each particular subject cannot be told apart, such as 3 copies of the same math book.

Accedi per commentare.

Categorie

Scopri di più su Financial Toolbox in Centro assistenza e File Exchange

Richiesto:

il 26 Gen 2026

Commentato:

il 26 Gen 2026

Community Treasure Hunt

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

Start Hunting!

Translated by