Badawy's first words were "AND 0 SUM BIG", so he chose to take care of the accompanying issue. Given two integers n and k, count the number of varieties of length n with the end goal that:    every one of its components are integers somewhere in the range of 0 and 2k−1 (comprehensive

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

Correct answer will be upvoted else downvoted. Computer science.

 

Child Badawy's first words were "AND 0 SUM BIG", so he chose to take care of the accompanying issue. Given two integers n and k, count the number of varieties of length n with the end goal that: 

 

every one of its components are integers somewhere in the range of 0 and 2k−1 (comprehensive); 

 

the bitwise AND of every one of its components is 0; 

 

the amount of its components is just about as extensive as could be expected. 

 

Since the appropriate response can be exceptionally enormous, print its remaining portion when isolated by 109+7. 

 

Input 

 

The principal line contains an integer t (1≤t≤10) — the number of experiments you wanted to settle. 

 

Each experiment comprises of a line containing two integers n and k (1≤n≤105, 1≤k≤20). 

 

Output 

 

For each experiment, print the number of clusters fulfilling the conditions. Since the appropriate response can be exceptionally huge, print its leftover portion when isolated by 109+7.

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
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