Create a java implementation checkplagiarism

Assignment Help JAVA Programming
Reference no: EM131587429

Question 1
Imagine that you are building an online plagiarism checker, which allows teachers in the land of Edutopia to submit papers written by their students and check if any of those students have copied whole sections from a set, D, of documents written in the Edutopian language that you have collected from the Internet. You have at your disposal a parser, P , that can take any document, d, and separate it into a sequence of its n words in their given order (with duplicates included) in O(n) time. You also have a perfect hash function, h, that maps any Edutopian word to an integer in the range from 1 to 1,000,000, with no collisions, in constant time. It is considered an act of plagiarism if any student uses a sequence of m words (in their given order) from a document in D, where m is a parameter set by parliament. Describe a system whereby you can read in an Edutopian document, d, of n words, and test if it contains an act of plagiarism. Your system should process the set of documents in D in expected time proportional to their total length, which is done just once. Then, your system should be able to pro- cess any given document, d, of n words, in expected O(n + m) time (not O(nm) time!) to detect a possible act of plagiarism.

Create a java implementation CheckPlagiarism.java that takes 3 commandline arguments - the corpus filename, the target filename and the length of the match sequence.
The corpus file has the format
<doc_num>:<text of the document>
For ex
134:"The quick brown fox jumped over the lazy dog"
145: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc pellentesque turpis lorem, at convallis massa euismod quis. Cras blandit rutrum lacus tempor suscipit. Vestibulum in sagittis sem. Vestibulum id gravida felis. Morbi venenatis interdum purus a tincidunt. Aenean vel maximus magna."
The target file contains the text to be checked
For ex
The quick brown fox ate its breakfast slowly
The length is the minimum match required to prove plagiarism For ex 3
With the above example, your program should say "Plagiarized from 134". If the target were "The quick black fox ate its breakfast slowly" then it should print "Not Plagiarized". You may use standard implementations for string processing and hash tables.


Question 2:
Suppose there is a computer game, Land-of-Candy(LoC), where a player moves through a three-dimensional world defined by the cells in an n × n × n array, C. Each cell, C[i, j, k], specifies the number of points that a player in LoC gets when they are at position (i, j, k). At the start of a game in LoC, there are only O(n) nonzero cells in C; all the other O(n^3) cells in C are equal to 0. During the course of the game, if a player moves to a position (i, j, k) such that C[i, j, k] is nonzero, then all the points in C[i, j, k] are awarded to the player and the value of C[i, j, k] is reduced to 0. Then the game picks another position, (i', j', k'), at random and adds 100 points to C[i',j',k']. The problem is that this game was designed for playing on a large computer and now must be adapted to run on a smartphone, which has much less memory. So you cannot afford to use O(n^3) space to represent C, as in the original version. Describe an efficient way to represent C, which uses only O(n) space. Also describe how to lookup the value of any cell, C[i, j, k], and how to add 100 points to any cell, C[i, j, k], efficiently so that looking up the value of any cell, C[i, j, k], can be done in O(log n) worst-case time or better.
Implement the java version that plays Land-Of-Candy interactively.
A sample execution is shown below
tiny_mce_markergt; java LandOfCandy 100
Enter the next position (or p to print current board): 10 10 10
No candy here
Enter the next position (or p to print current board or q to quit): 10 20 10
Candy awarded! Total points: 100
Enter the next position (or p to print current board or q to quit): 73 20 10
Candy awarded! Total points: 200
Enter the next position (or p to print current board or q to quit): p
Candy found at
(11,22,33)
(65,78,16)
(99,99,99)
Enter the next position (or p to print current board or q to quit): q
tiny_mce_markergt;

Reference no: EM131587429

Questions Cloud

Proposal for argumentative essay : Proposal for Argumentative essay, requirement- Give the reader context and provide a description of the issue
Actions can result in improved job satisfaction : Several basic attitudes and actions can result in improved job satisfaction. How do certain actions at work increase your enjoyment of life?
Describe some real life applications : Give examples of real-life problems involving geometry.
Current rate be on three year treasury securities : what should the current rate be on 3-year Treasury securities.
Create a java implementation checkplagiarism : Create a java implementation CheckPlagiarism.java that takes 3 commandline arguments - the corpus filename, the target filename and the length of the match
Define rhetoric is the counterpart of dialectic : Aristotle believed that "rhetoric is the counterpart of dialectic." Outline Aristotle's definition of rhetoric as it relates to dialectic
What is the security equilibrium rate of return : what is the security’s equilibrium rate of return.
Calculate expected npv for minimum ror : Calculate Expected NPV for minimum ROR 16% on buying and drilling an oil lease with these estimated costs:
What measurement issues are illustrated by this discussion : Research the measurement requirements for inventories held for sale, inventories held for production, and long-term debt

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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