McqMate

Q. |
## You are given n dice each having f faces. You have to find the number of ways in which a sum of S can be achieved. This is the dice throw problem. Which of the following methods can be used to solve the dice throw problem? |

A. | brute force |

B. | recursion |

C. | dynamic programming |

D. | brute force, recursion and dynamic programming |

Answer» D. brute force, recursion and dynamic programming | |

Explanation: brute force, recursion and dynamic programming can be used to solve the dice throw problem. |

1.7k

0

Do you find this helpful?

13

View all MCQs in

Design and Analysis of AlgorithmsNo comments yet

- There are 10 dice having 5 faces. The faces are numbered from 1 to 5. What is the number of ways in which a sum of 4 can be achieved?
- You have 2 dice each of them having 6 faces numbered from 1 to 6. What is the number of ways in which a sum of 11 can be achieved?
- You have n dice each having f faces. What is the number of permutations that can be obtained when you roll the n dice together?
- You have 3 dice each having 6 faces. What is the number of permutations that can be obtained when you roll the 3 dice together?
- There are n dice with f faces. The faces are numbered from 1 to f. What is the minimum possible sum that can be obtained when the n dice are rolled together?
- There are n dice with f faces. The faces are numbered from 1 to f. What is the maximum possible sum that can be obtained when the n dice are rolled together?
- You are given infinite coins of N denominations v1, v2, v3,…..,vn and a sum S. The coin change problem is to find the minimum number of coins required to get the sum S. What is the time complexity of a dynamic programming implementation used to solve the coin change problem?
- Given a string, you have to find the minimum number of characters to be inserted in the string so that the string becomes a palindrome. Which of the following methods can be used to solve the problem?
- Given a rod of length n and the selling prices of all pieces smaller than equal to n, find the most beneficial way of cutting the rod into smaller pieces. This problem is called the rod cutting problem. Which of these methods can be used to solve the rod cutting problem?
- Given an array, check if the array can be divided into two subsets such that the sum of elements of the two subsets is equal. This is the balanced partition problem. Which of the following methods can be used to solve the balanced partition problem?