case there are two planes and a molecule is shot with rot age 3 (towards the right), the cycle is as per the following: (here, D(x) alludes to a solitary molecule with rot age x)    the primary plane delivers a D(2) to the left and lets D(3) progress forward to the right;    the subsequent plane delivers a D(2) to the left and lets D(3) progress forward to the right;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Correct answer will be upvoted else downvoted. Computer science.

 

 in case there are two planes and a molecule is shot with rot age 3 (towards the right), the cycle is as per the following: (here, D(x) alludes to a solitary molecule with rot age x) 

 

the primary plane delivers a D(2) to the left and lets D(3) progress forward to the right; 

 

the subsequent plane delivers a D(2) to the left and lets D(3) progress forward to the right; 

 

the primary plane lets D(2) forge ahead to the left and creates a D(1) to the right; 

 

the subsequent plane lets D(1) progress forward to one side (D(1) can't create any duplicates). 

 

Altogether, the last multiset S of particles is {D(3),D(2),D(2),D(1)}. (See notes for visual clarification of this experiment.) 

 

Gaurang can't adapt up to the intricacy of the present circumstance when the number of planes is excessively huge. Help Gaurang find the size of the multiset S, given n and k. 

 

Since the size of the multiset can be extremely huge, you need to output it modulo 109+7. 

 

Note: Particles can go to and fro between the planes without crashing into one another. 

 

Input 

 

The primary line of the input contains the number of experiments t (1≤t≤100). Then, at that point, t lines follow, each containing two integers n and k (1≤n,k≤1000). 

 

Moreover, the amount of n over all experiments won't surpass 1000, and the amount of k over all experiments won't surpass 1000. All experiments in a single test are unique. 

 

Output 

 

Output t integers. The I-th of them ought to be equivalent to the response to the I-th experiment.

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Probability Problems
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education