Write the code and comment using Java Eclipse the description of numbers not fou
ID: 3751112 • Letter: W
Question
Write the code and comment using Java Eclipse the description of numbers not found on any one board as input to your program (your choice of using user input or a file for input, although using a file limits typos by the user), find and output the Bingo board, then output the row or column or diagonal only that is the “winning” BINGO. Translating the written description into an useful input format is probably the hardest part of this assignment (the other major design decision is whether to store the internal board numbers as integers or strings), although I found having the input line number being the number to remove from the selected cells made the program easier to write with line ten being the zero’s to remove, line eleven being the single double digit to keep, and line twelve (if necessary) being the consecutive digits to keep. BINGO PLAYS 1 Each square on the Bingo playing card contains 15 numbers (with the exception of the "FREE" space, which has no number in it). Follow the clues to eliminate numbers until you are left with only one number in each square. No number will be repeated in any column. Then find your winning Bing combination-just as in Bingo, the numbers in only one row, column, or diagonal will fit the ciues given. Note: It is helpful to go back and read the clues a second time, remembering to ei those numbers which do not appear in the winning combination. Solution is on page 121 1. The number one does not appear on 6. The number six does not appear the card as a single-digit number, nor does it appear in row L, column N, or square PB, PO, AB, YI, YG, YO, SI, or card as a single-digit number, nor does it appear in row A or Y, column G, or square LI or SI. e number seven does not appear on the card as a single-digit number, nor does it appear in row L, column I, square PG, PO, YG, SG, or SO, or in the winning combination. 2. The number two does not appear in row P, column N, or square AI, AO, YB, 3. The number three does not appear on 8. The number eight does not appear in the card as a single-digit number, nor does it appear in row Y, column I or O, row S or square PB, PN, PO, LI, LN LG, LO, AB, YI, or YG 9. The number nine does not appear square PI, PN, PG, PO, LI, LN, LO, AI AG, YG, SG, or SO or in the winning 4. The number four does not appear in column B or square PN, LI, LN, LG, AO, YI, YG, YO, or SG. 10. Zero does not appear in square LG, YB The number five does not appear on the card as a single-digit number, nor does it appear in column N or O or YN, YG, SB, or SG. 11. The number 44 is the only same-digit are PG, LI, AG, YI, or SI double-number combination on the card 1234 16 17 18 19 31 32 33 34 46 47 48 49 61 62 63 64 5678 20 21 22 23 35 36 37 38 50 51 52 53 65 66 67 68 10 11 12 24 25 26 27 39 40 41 42 54 55 56 57 69 70 71 72 13 14 15 28 29 30 43 44 45 58 59 60 73 74 75 1234 16 17 18 19 31 32 33 34 46 47 48 49 61 62 63 64 5678 20 21 22 23 35 36 37 38 50 51 52 53 65 66 67 68 10 11 12 24 25 26 27 39 40 41 42 54 55 56 57 69 70 71 72 3 14 15 28 29 30 43 44 45 58 59 60 737475 1234 16 17 1819 567820 21 22 23 46 47 48 49 61 62 63 64 50 51 52 53 65 66 67 68 4 55 56 57 69 70 71 72 9 10 11 12 24 25 26 27 FREE 13 14 1528 29 30 58 59 6073 74 75 234 16 17 18 19 31 32 33 34 46 47 48 49 61 62 63 64 5678 20 21 22 23 35 36 37 38 50 51 52 53 65 66 67 68 910 11 12 24 25 26 27 39 40 41 42 54 55 56 57 69 70 71 72 13 14 15 28 29 30 43 44 45 58 59 60 73 74 75 1 234 16 17 18 19 31 32 33 34 46 47 48 49 61 62 63 64 56 78 20 21 22 23 35 36 37 38 50 51 52 53 65 66 67 68 9 10 11 12 24 25 26 27 39 40 41 42 54 55 56 57 69 70 71 72 13 14 1528 29 30 43 44 45 58 59 60 73 7475Explanation / Answer
The reflexive closure of a binary relation R on a set X is the smallest reflexive relation on X that contains R. For example, if X is a set of distinct numbers and x R y means "x is less than y", then the reflexive closure of R is the relation "x is less than or equal to y".
Symmetric closure:
The symmetric closure of a binary relation R on a set X is the smallest symmetric relation on X that contains R. For example, if X is a set of airports and xRy means "there is a direct flight from airport x to airport y", then the symmetric closure of R is the relation "there is a direct flight either from x to y or from y to x". Or, if X is the set of humans (alive or dead) and R is the relation 'parent of', then the symmetric closure of R is the relation "x is a parent or a child of y".
Let MRMR denotes the matrix representation of R. Take W0=MR,W0=MR, We have
W0=MR=1001011001101001W0=MR=(1001011001101001) and n=4n=4 (As MRMR is a 4×44×4 matrix)
We compute W4W4 by using warshall's algorithm.
For k=1. In column 1 of W0W0, ‘1’ is at position 1, 4. Hence p1=1,p2=4p1=1,p2=4.
In row 1 of W0W0 ‘1’ is at position 1, 4. Hence q1=1,q2=4q1=1,q2=4.
Therefore, to obtain W1W1, we put ‘1’ at the position:
{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(1,1),(1,4),(4,1),(44)}{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(1,1),(1,4),(4,1),(44)}. Thus,
W1=1010000001101111W1=[1001001110110001]
For k=2. In column 2 of W1W1, ‘1’ is at position 2, 3. Hence p1=2,p2=3p1=2,p2=3.
In row 2 of W1W1 ‘1’ is at position 2, 3. Hence q1=2,q2=3q1=2,q2=3.
Therefore, to obtain W2W2, we put ‘1’ at the position:
{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(2,2),(2,3),(3,2),(3,3)}{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(2,2),(2,3),(3,2),(3,3)}. Thus,
W2=1010000001101111W2=[1001001110110001]
For k=3. In column 3 of W2W2, ‘1’ is at position 2, 3. Hence p1=2,p2=3p1=2,p2=3.
In row 3 of W2W2 ‘1’ is at position 2, 3. Hence q1=2,q2=3q1=2,q2=3.
Therefore, to obtain W3W3, we put ‘1’ at the position:
{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(2,2),(2,3),(3,2),(3,3)}{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(2,2),(2,3),(3,2),(3,3)}. Thus,
W3=1010000001101111W3=[1001001110110001]
For k=4. In column 4 of W3W3, ‘1’ is at position 1, 4. Hence p1=1,p2=4p1=1,p2=4.
In row 4 of W3W3 ‘1’ is at position 1, 4. Hence q1=1,q2=4q1=1,q2=4.
Therefore, to obtain W3W3, we put ‘1’ at the position:
{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(1,1),(1,4),(4,1),(44)}{(p1,q1),(p1,q2),(p2,q1),(p2,q2)=(1,1),(1,4),(4,1),(44)}. Thus,
W4=1010000001101111W4=[1001001110110001]
Thus, the transitive clousure of R is given as
R= {(1, 1), (1, 4), (2, 2), (2, 3), (3, 2), (3, 3), (4, 1), (4, 4)}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.