Questions
[P∧¬P]→Q is a tautology and is a valid argument. A valid argument can be sound or...

[P∧¬P]→Q is a tautology and is a valid argument. A valid argument can be sound or unsound. An invalid argument, however, can not be sound. Would the above argument be sound or sound? Why or why not?

In: Computer Science

in java Write program that draws out a path based on the user input. The starting...

in java

Write program that draws out a path based on the user input. The starting coordinates for the path is the middle of the DrawingPanel. Ask the user to enter an x and a y coordinate for a DrawingPanel. Your program will draw a line from the last coordinates to the current coordinates the user enters. If the user enters an x value or y value out of bounds of the DrawingPanel, then end the program.

In: Computer Science

Assuming binding priority (¬, ∧, ∨, →), are these sequents valid or not? If they are...

Assuming binding priority (¬, ∧, ∨, →), are these sequents valid or not? If they are valid, how do you prove it? If they are not valid, what would the truth table be?

  1. A → B, C → D ⊢ A ∨ C → B ∧ D
  2. A ∧ ¬A ⊢ ¬(B → C) ∧ (B → C)
  3. (A ∧ B) → C, C → D, B ∧ ¬D ⊢ ¬A

In: Computer Science

1. What is the ouput (what are in the Bag) when the 2 below lines are...

1. What is the ouput (what are in the Bag) when the 2 below lines are executed? Please show the steps. String[] items = {"Z", "Y", "Y", "X", "S", "C", "A", "E", "M"}; testAdd(aBag, items);

2.

What is the output (what are in the Bag) when the 3 below lines are executed? Please show the steps.

String[] testString = { "X", "Y", "Z" };

aBag.removeAllOccurences(testString);

displayBag(aBag);

In: Computer Science

2. Create two class, a student class, and a course class, take advantage of the codes...

2. Create two class, a student class, and a course class, take advantage of the codes provided in the class slides and sample codes. python

Student

Course

__Username:str

__Courses:list

__courseName:str

__students: list

addCourse():None

dropCourse():None

getCourse():list

addStudent:None

dropStudent:None

getStudents():list

getNumber of students:int

3. Create a student object for every student in the UD.txt (you can use a loop for this)

4. Create 6 course objects:

1. CS131

2. CS132

3. EE210

4. EE310

5. Math320

6. Math220

5. After the student user login to their account as we have done in lab 2. Display the following:

A: Show all courses available

B: Add a course

C: Drop a course

D: Show all my courses

E: Exit

When students choose option A, should display the following, where # is the actual number of students enrolled in the class.

1. CS131                                         students number:#

2. CS132                                         students number:#

3. EE210                                         students number:#

4. EE310                                         students number:#

5. Math 320                                   students number:#

6. Math 220                                   students number:#

Let the students add or drop a classes as they wish. When they choose E, exit the program.

6. For option D, show the courses in the student’s course list.

7. The hard part. Since your program will end when user chose option E. You need to keep track the classes been added and dropped by each students, and who are actually in the classes. Therefore, based on your experiences in lab 3 and 4, create a SI.txt (student info) to store the courses in each student’s course list. Create CI.txt (course info) to store all the students enrolled in each course. This will be executed in the background every time when the user chose option E: Exit. When you run your program, and create your course objects, this information needs to be read into each student and course object. When a student log into his or her account, the student should be able to see what courses is in the course list by chose option D. The number of students in each course also need to be displayed in Option A.

Student info

UD.txt

USERNAME,PASSWORD
sdd233,Pad231
dcf987, BHYW4fw
dgr803,Sb83d2d
mkr212,UNNHS322
lki065,dgw6234
ped332,9891ds
ytr876,dsid21kk
nmh223,3282jd3d2

In: Computer Science

C programing. Ask user to enter a word on sting and print all possible combinations. (please...

C programing.
Ask user to enter a word on sting and print all possible combinations. (please don't use printer) Using recursion.
example
ask user to input
user: "ABC"
output:
ABC
ACB
BAC
BCA
CAB
CBA

In: Computer Science

What to do This assignment is going to be pretty simple - we're just going compute...

What to do

This assignment is going to be pretty simple - we're just going compute frequency counts of certain colors in certain ranges (Histogram of the image).

Because there is no natural way of segregating RGB color ranges, we usually do this color by color. So you'll be computing frequency counts for individual color components individually.

The expectation is that you will write a function as described by a python function signature below (while you are free to do whatever you want, I think doing future parts of the assignment will be easier if the code is structured this way) -

Think about what happens when one is comparing images of different sizes -

  • Lets say A is an 4 by 4 image where half of the colors are gray (rgb(128, 128, 128)), and the other half is white (rgb(255, 255, 255))
  • When you compute frequencies for Red component, you'll find that 128 occurs 8 times and 255 occurs 8 times also.
  • Lets say B is an 8 by 8 image where half of the colors are gray (rgb(128, 128, 128)), and the other half is white (rgb(255, 255, 255))
  • When you compute frequencies for Red component, you'll find that 128 occurs 32 times and 255 occurs 32 times also.
  • This would mean that images that are basically the same in terms of colors (both half gray and white), end up with different histograms.

To make sure similar images have similar histograms regardless of image size, it is good to normalise frequencies by dividing each frequency count by the total number of pixel in the image.

  • After normalization, frequency for red 128 in A would be 8 / (4 * 4) = 0.5
  • After normalization, frequency for red 128 in B would be 32 / (8 * 8) = 0.5
  • You will be given an image as a text file in the format we've been using so far - assignment_files.zip

In: Computer Science

Select/identify 20 programming languages 1)Draw a graph, a chart or a table that shows the history/timeline...

Select/identify 20 programming languages

1)Draw a graph, a chart or a table that shows the history/timeline of the development of the chosen 20
programming languages over years.

2)Identify the domain (area) that each one of the 20 programming languages is used in. The well known
programming domains are:
a. Scientific Applications
b. Business Applications
c. Artificial Intelligence
d. Systems Programming
e. Web Software

In: Computer Science

im getting this Error: Main method not found in class Tuple, please define the main method...

im getting this

Error: Main method not found in class Tuple, please define the main method as:
public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

please modify the code

import java.io.InvalidClassException;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class Tuple {

private List<Object> fields; // stores the fields(s) of the tuple in the original sequence

public Tuple(List<Object> fields) throws InvalidClassException {
this.fields = fields;
}

// gets the fields of this tuple
public List<Object> getFields() {
return fields;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Tuple tuple = (Tuple) o;
return Objects.equals(fields, tuple.fields);
}

@Override
public int hashCode() {
return Objects.hash(fields);
}

@Override
public String toString() {
return "Tuple{" +
"fields=" + fields +
'}';
}
}

In: Computer Science

Research one attack of transport layer of TCP/IP model and answer the following questions what was...

Research one attack of transport layer of TCP/IP model and answer the following questions
what was the attack?
what layer the attack is done
describe the attack what it is
what does attack hope to achieve
Relate to CIA train
what network vulnerabilities does attack take advantage of
what can be done to mitigate the attack
please attach the reference with answer

In: Computer Science

Furnish definitions and descriptions for: ▪ IP address and Subnet mask

Furnish definitions and descriptions for:

▪ IP address and Subnet mask

In: Computer Science

Assignment – 1 1- The DISTINCT(X) operator is used to return only distinct (unique) values for...

Assignment – 1

1- The DISTINCT(X) operator is used to return only distinct (unique) values for datatype (or column) X in the entire dataset .

As an example, for the following table A:

A.ID

A.ZIPCODE

A.AGE

1

12345

30

2

12345

40

3

78910

10

4

78910

10

5

78910

20

DISTINCT(A.ID) = (1, 2, 3, 4, 5)

DISTINCT(A.ZIPCODE) = (12345, 78910)

DISTINCT(A.AGE) = (30, 40, 10, 20)

Implement the DISTINCT(X) operator using Map-Reduce. Provide the algo-

rithm pseudocode. You should use only one Map-Reduce stage, i.e. the algorithm should

make only one pass over the data.

2-The SHUFFLE operator takes a dataset as input and randomly re-orders it.

Hint: Assume that we have a function rand(m) that is capable of outputting a random integer between [1, m].

Implement the SHUFFLE operator using Map-Reduce. Provide the algorithm pseudocode.

3-What is the communication cost (in terms of total data flow on the network between mappers and reducers) for following query using Map-Reduce:

Get DISTINCT(A.ID from A WHERE A.AGE > 30 )

The dataset A has 1000M rows, and 400M of these rows have A.AGE <= 30. DISTINCT(A.ID) has 1M elements. A tuple emitted from any mapper is 1 KB in size.

4-Consider the checkout counter at a large supermarket chain. For each item sold, it generates a record of the form [ProductId, Supplier, Price]. Here, ProductId is the unique identifier of a product, Supplier is the supplier name of the product and Price is the sales price for the item. Assume that the supermarket chain has accumulated many terabytes of data over a period of several months.

The CEO wants a list of suppliers, listing for each supplier the average sales price of items provided by the supplier. How would you organize the computation using the Map-Reduce computation model?

For the following questions give short explanations of your answers.

5-True or False: Each mapper/reducer must generate the same number of output key/value pairs as it receives on the input.

6-True or False: The output type of keys/values of mappers/reducers must be of the same type as their input.

7-True or False: The input to reducers is grouped by key.

8-True or False: It is possible to start reducers while some mappers are still running.

In: Computer Science

April   107   90   29   31   66   0.344 May   106   94   23   35   72   0.372 June   77  ...

April   107   90   29   31   66   0.344
May   106   94   23   35   72   0.372
June   77   62   12   18   29   0.29
July   115   103   20   34   59   0.33
August   124   102   25   36   63   0.353
September   85   69   20   26   44   0.377

(PYTHON)

Using the attached stats.txt, generate a report of a player’s batting average using hits / at bats by month and slugging percent by dividing total bases by at bats. Print out each month, number hits, number of at bats , BA (batting average) and slugging percent (). The input file is organized by month, plate appearances, at bats, runs, hits and total bases.

In: Computer Science

Discuss hyper-social organizations and their growing popularity. Discuss the reasons for globalization and for using global...

Discuss hyper-social organizations and their growing popularity.

Discuss the reasons for globalization and for using global information systems, including e-business and Internet growth.

Discuss the obstacles that organizations face in implementing and using global information systems.

In: Computer Science

Khan Academy (2019) Measures of Central Tendency and Khan Academy (2019) Measures of Dispersion what is...

Khan Academy (2019) Measures of Central Tendency and Khan Academy (2019) Measures of Dispersion what is the difference between and common?

In: Computer Science