Anticipating calculations utilized in VK have effectively assessed the likelihood for every occasion to occur. Occasion in line I and section j will occur with likelihood ai,j⋅10−4. Every one of the occasions are autonomous together.

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. Code and output screenshot.

 

 

Anticipating calculations utilized in VK have effectively assessed the likelihood for every occasion to occur. Occasion in line I and section j will occur with likelihood ai,j⋅10−4. Every one of the occasions are autonomous together. 

 

How about we call the table winning if there exists a line to such an extent that all n occasions on it occur. The line could be any flat line (cells (i,1),(i,2),… ,(i,n) for some I), any upward line (cells (1,j),(2,j),… ,(n,j) for some j), the fundamental corner to corner (cells (1,1),(2,2),… ,(n,n)), or the antidiagonal (cells (1,n),(2,n−1),… ,(n,1)). 

 

View the likelihood of your table to be winning, and output it modulo 31607 (see Output area). 

 

Input 

 

The primary line contains a solitary integer n (2≤n≤21) — the elements of the table. 

 

The I-th of the following n lines contains n integers ai,1,ai,2,… ,ai,n (0<ai,j<104). The likelihood of occasion in cell (i,j) to happen is ai,j⋅10−4. 

 

Output 

 

Print the likelihood that your table will be winning, modulo 31607. 

 

Officially, let M=31607. It tends to be shown that the appropriate response can be communicated as an unchangeable division pq, where p and q are integers and q≢0(modM). Output the integer equivalent to p⋅q−1modM. At the end of the day, output such an integer x that 0≤x<M and x⋅q≡p(modM).

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