A boolean matrix has the parity property

Assignment Help Basic Computer Science
Reference no: EM13163661

Description:
A Boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:
The sums of the rows are 2, 0, 4 and 2. The sums of the columns are 2, 2, 2 and 2. In this homework, you are asked to write a program that reads in a matrix to a multiple-subscripted array and checks if it has the parity property.
Input:
The first line of each test case contains one integer n (n<100), representing the size of the matrix. On the next n lines, there will be n integers per line. No other integers than 0 and 1 will occur in the matrix.
Output:
For the matrix in the input, print one line. If the matrix already has the parity property, print "Yes", print "No" otherwise.
Sample Input I:
4
1 0 1 0
0 0 0 0
1 1 1 1
0 1 0 1
Sample Output I:
Yes
Sample Input II:
4
1 0 1 0
0 1 1 0
1 1 1 1
0 1 0 1
Sample Output II:
No

Reference no: EM13163661

Questions Cloud

Discuss the issues that managing and implementing : Discuss the issues that managing and implementing the technology architecture you would have and how you would overcome these challenges. Be sure to discuss at least three challenges.
Give a recursive definition of s. : Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)
Define three types of programming errors : Define three types of programming errors and explain with examples
Create a set of instructions : Provide a private address to be used for the AS and a public address to be used to connect to an ISP router connected to a border router.Create a set of instructions for the lab that would have students create a basic configuration and test connecti..
A boolean matrix has the parity property : A Boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the parity property:
Same directory as your program : In the same directory as your program, create a file FF1, and write into it Hello (with a space at teh end). Similarly, create a file FF2, and write into it world! (with a new line, i.e., an ENTER at the end). And create a file DD and write into i..
Multiple choice question on networking : 1-Which of the following extensions point to an executable string of code?
Write a function trans(m) which returns the transpose : Write a function trans(M) which returns the transpose of an n-by-n matrix M. The matrix M is represented by a list of n lists, each of length n. Transposing M means that each M[i][j] is swapped (once!) with M[j][i].
True or false about networking : 2- A print queue must be set up for every printer on the network served by a print server. True False

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Enforcing mandatory access control environment

Users dont seem to understand that they need to handle certain documents with more care and control than others. Which of the following will improve this situation?

  Create logic circuit to decode dtmf-like keypad

Create the logic circuit which will decode a DTMF-like keypad. Keypad comprises of 16 keys, numbered 0 to 9, *, #, A, B, C, and D. Underneath keypad are four horizontal lines and four vertical lines.

  Lan device

Your wireless LAN device has just sent a request to send (RTS). What happens next?

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Function in programs to print upside down triangles

Apply function in programs to prints triangles, upside down triangles, and diamond.

  How spki be augmented to support policy

Consider a policy that, for reasons of separation of duties, does not allow an entity to exercise the rights it may grant (delegate) to others. How could SPKI be augmented to support such a policy?

  Create analysis and design project by part of local business

Recognize part of local business or organization which you can use for analysis and design project. You must explain the scope of project.

  Calculate the median of an array

Calculate the median of an array in mips, the array needs to use floating point numbers not integers.The output should look something like this were you enter numbers in and it prints the array and prints the median.Enter a number

  How applications of technology used to overcome barrier

Explain how applications of technology could be used as the means to overcome each of these barriers. Write at a minimum the applications which use word processing.

  Approach appropriate for company forefront of technology

However, adopting a secondary approach where others adopt early and a firm learns from their mistakes is often a viable strategy. When is each approach most appropriate and why?

  How much storage will probe require if it is to gather data

The system has a clock that runs at 1GHz. During each cycle of the system clock, the status of these 5 registers how much storage will the probe require if it is to gather data for 2 seconds?

  Explaining quasi-legal activities over internet

Online gambling and buying of pharmaceutical drugs over the Internet are quasi-legal activities which can only take place as Internet allows the parties offering gambling.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd