Foundations of Algorithms

The following are analytical and programming problems to be completed by individual students (i.e., this is NOT
a collaborative assignment). Please follow the requirements provided under the link Programming Assignment
Requirements.
Problems for Grading

  1. [50 Points] Closest Pairs
    In this form of algorithm development there are several practical applications, such as but not limited to moving
    objects in a game, classification algorithms, computational biology, computational finance, genetic algorithms,
    and N-body simulations.
    In these implementations ensure you output your results to the command window for a two dimensional arrays
    A ≤ 30 values, e.g. “double[][] A= new double[30][2];”. For a two dimensional array A > 30 please
    create output files.
    (a) [12.5 Points] Construct a brute-force algorithm (pseudocode) for finding the closest pair of points in a
    set of n points in a two dimensional plane and show the worst-case big-O estimate for the number of
    operations used by the algorithm. Hint: First determine the distance between every pair of points and
    then find the points with the closest distance.
    (b) [12.5 Points] Implement the brute-force algorithm from part (a).
    (c) [12.5 Points] Given a set of n points (x1, y1), …,(xn, yn) in a two dimensional plan, where the distance between two points (xi
    , yi) and (xj , yj ) is measured by using the Euclidian distance p
    (xi − xj )
    2 + (yi − yj )
    2,
    design an algorithm (pseudocode) to find the closest pair of points in a more efficient efficient way than
    part a and the worst-case big-O estimate.
    (d) [12.5 Points] Implement the the algorithm from part (c) with the following methods:
    i. The distance of the closest pair of points.
    ii. The n pair of closest points.
    iii. The distance values for the n points.
  2. [50 Points] Deterministic Turing Machine (DTM)
    In 1900, mathematician David Hilbert enumerated 23 mathematical problems he considered challenges for the
    coming century. The tenth problem is his list concerned algorithms: Given a polynomial, find an “algorithm”
    for determining whether the polynomial has an integral root.In the way Hilbert phrased the above problem, he
    explicitly asked that an algorithm be “devised”.As we now know, no algorithm exists for this task if the polynomial is de-fined on several variables. That is, the above problem is algorithmically unsolvable. However,
    mathematicians of that period could not come to this conclusion with their intuitive notion of algorithm.
    Although our intuitive notion of an algorithm is enough to “devise” solutions for certain problems (the ones
    a computer can solve), it is useless for showing that no algorithm exists for a particular task, as our intuitive
    notion is not a formal one.So, proving that an algorithm does not exist required having a clear definition of
    algorithm.Such a definition was simultaneously given in 1936 by Alonzo Church and Alan Turing.Church used
    a notational system called the lamda calculus to precisely define algorithms.Turing did it with his “machines”
    1
    This connection between the informal notion of algorithm and the precise definition is known as the the
    Church-Turing thesis. More precisely, Turing proposed to adopt the Turing machine that halts on all inputs as
    the precise formal notion corresponding to our intuitive notion of an “algorithm”. Note that the Church-Turing
    thesis is not a theorem, but a “thesis”, as it asserts that a certain informal concept (algorithm) corresponds to
    a certain mathematical object (Turing machine).
    Since Turing machines can only deal with decision problems, you may find very strange the fact that a Turing
    machine is a formal counterpart of our intuitive notion of an algorithm, as many computational problems are
    not decision problems.Well, keep in mind that every computational problem is either equivalent to a decision
    problem or is at least as “hard” as some decision problem. So, the restriction to decision problems is not a
    problem.Besides helping us understand what we can or cannot do with computers, Turing machines can also
    be used to formally define the complexity of an algorithm.
    In this problem you will implement two variants of a DTM. The definition and example are provided below
    followed by the two required implementations. A deterministic Turing machine consists of the following:
    • A finite state control,
    • A tape consisting of a two-way sequence of tape squares, and
    • A read-write head.
    A given DTM is manipulated through the execution of a program utilizing the following components:
    • A finite set Γ of symbols,
    • A finite set Q of states (q0 is designated as the start state and qY and qN are designated as halting
    states), where {q0, qH} ∈ Q,
    • The direction. s = (left, right, halt), where left = -1 and right = +1, in which to move the tape head s ∈ Q
    • A transition function δ : (Q − {qY , qN }) × Γ → Q × {+1, 0, −1},
    • Σ ⊂ Γ as a set of input symbols, and
    • b ∈ (Γ − Σ) corresponds to the ”blank symbol” (#)
    This allows a DTM to be represented as a finite set of program lines with the form of a 6-tuple TM M =
    (Γ, Q, s, δ, Σ, b).
    In other words, the DTM will scan the tape, and the transition function will read the symbol from Γ currently
    written on the table and determine what character to write in its place as well as which direction s to move
    the read-write head. Presumably, if the program indicates +1, the head moves to the right, if the program
    indicates −1, the head moves to the left and if the program indicates 0, the head stays still.
    To see how a DTM works, suppose we have Σ ⊂ Γ as a set of input symbols and b ∈ (Γ − Σ) a ”blank symbol”
    (#). Next suppose we have an input string x ∈ Σ
    ∗ where we place the symbols of x in consecutive cells of the
    tape in positions 1…|x|. All other cells on the tape are assumed to have b. The program will begin in state q0
    with the read-write head scanning square 1 and proceed according to the transition function.
    If the current state of the DTM is ever qY or qN , then the program terminates. On the other hand, if the current
    state is in Q − {qY , qN }, then the program continues. When transitioning, the read-write head will first erase
    the symbol in the square it is examining and then write the new symbol as specified by the transition function.
    The read-write head then either moves one position to the right or one position to the left, and the Finite State
    Control updates the state to some successor q
    0
    .
    Because we have limited the set of halting (or terminal) states to qY , qN , we note that a DTM is only able
    to solve problems that return a Boolean result. In particular, we say that a DMT is used to solve decision
    problems where qY indicates the DMT has decided yes and qN indicates the DTM has decided no.
    The set of states is defined to be Q = q0, q1, q2, q3, qY , qN , and the transition function δ is defined by the
    following table:
    2
    start q0 q1 q2
    q3
    qY
    qN
    0, 1, [R]
    b, [L]
    0, !b, [L]
    1, !b, [L]
    b, [L]
    0, !b, [L]
    1, !b, [L]
    b, [L]
    0, 1, b, [L]
    Figure 1: DTM State Diagram
    Table 1: DTM model illustrated in Figure 1.
    Q − {qY , qN } 0 1 b
    q0 (q0, 0, +1) (q0, 1, +1) (q1, b, −1)
    q1 (q2, b, −1) (q3, b, −1) (qN , b, −1)
    q2 (qY , b, −1) (qN , b, −1) (qN , b, −1)
    q3 (qN , b, −1) (qN , b, −1) (qN , b, −1)
    To reiterate how the DTM works, Table 1 represents the states q = Q − {qY , qN }, symbols in x, and the
    direction the read-write head moves (s). Starting with the initial state represented with q0 the finite controller
    reads the initial symbol represented by x. At each step the controller reads the symbol x on the tape at state
    q, enters the state q
    0 = Q = q0, q1, q2, q3, qY , qN , writes the symbol x
    0
    in the current cell, erasing x, and moves
    in the direction identified by s. This is represented as the five-tuple (q, x, q0
    , x0
    , s) TM. For Table 1 the DTM is
    represented by the following finite-state machine in Figure 1. The edges in Figure 1 are labeled with the symbol(s) on the tape, a symbol that overwrites the current symbol (if any), and the direction of tape movement.
    For example, (1, !b, [R]) on the edge between q1 and q3 denotes when the read/write head is over a symbol 1
    while in state q1 overwrite the 1 with b and move the tape to the right.
    Please note that you can define other symbols in Γ and you should. Consider representing two unary numbers
    on the tape and performing the operations in your assignment. If you include S,E in your set Γ you could use
    those symbols to recognize the start of data on the tape (S) and the end of data on the tape (E) making those
    symbols available to you in your state modeling. Remember that each state must fully define the operation of
    the DTM in that state for each symbol in Γ.
    (a) [25 Points] Implement the DTM example provided in the Course Content under Module 3. Ensure that
    your components as listed above are clearly identified in your variable list. The finite-state machine
    with the individual states, state table and five-tuple TM are shown in the above example. You should
    implement the following methods:
    i. States method, this method should have all of the operations of your TM.
    ii. Program line that executes the operations for each identified state, this should follow the n-tuple TM
    as described above for M.
    iii. Print method that outputs the change in tape (x ≤ 30) after each transition function is executed.
    iv. Write method, for tape larger than x > 30 write the outputs to a file
    (b) [25 Points] Expand the implementation of the DTM in part (a) to perform additional binary operations
    (addition, subtraction, multiplication) at each state. You should implement the following methods that will
    allow for other operations:
    3
    i. Addition – The tape will need to handle variable length binary inputs, e.g., tape values of 01100101
    add 101 or add 101101101.
    Table 2: Binary Addition Rules
    Operation
    x + x
    0
    Sum Carry
    0 + 0 0 0
    0 + 1 1 0
    1 + 0 1 0
    1 + 1 0 1
    ii. Subtraction – The tape will need to handle variable length binary inputs, e.g., tape values of 01100101
    subtract 101 or subtract 101101101.
    Table 3: Binary Subtraction Rules
    Operation
    x − x
    0
    Sum Carry
    0 − 0 0 0
    0 − 1 0 1
    1 − 0 1 0
    1 − 1 0 0
    iii. Multiplication – The tape will need to handle variable length binary inputs, e.g., tape values of
    01100101 multiply 101 or multiply 101101101.
    Table 4: Binary Multiplication Rules
    Operation
    x × x
    0
    Multiplication
    0 × 0 0
    0 × 1 0
    1 × 0 0
    1 × 1 1
    4

The post Foundations of Algorithms appeared first on homework handlers.

Article

  • Sponsorship is a mature marketing tool and should be taken more seriously by brands, agencies and rights holders.
  • Sponsorship is difficult to manage because a successful sponsorship is dependent upon the performance of the actors on the pitch, court or venue and the outcome of the result.
  • The live experience will always be the main focus for sports fans which limits the potential to maximize the impact for sponsors.

write  paragraph about each statement in one full page. Include and article for each one and your opinion.  

SOCIOLOGY/CRIMINAL JUSTICE ARTICLE REVIEW AND CRITIC

Description

Paper Components (writing and substantive): (+12 points maximum)

  1. Use In-text Citation Throughout Paper for Quotes and Paraphrases: (+0.5 points)
    See:https://owl.purdue.edu/owl/research_and_citation/using_research/formatting_in_sociology_asa_style/in_text_citation_references.html
    · Cite the article several times when you are summarizing it (usually multiple times a paragraph) with the author’s last name(s) and year in parentheses (Fox and Savage 2009). Can cite at end of sentence or at start of sentence: “According to Fox and Savage (2009),…”
    · Add a page number for any specific information such as statistics and for quotes (Kaufman 2009: 287).
    · For more than 3 authors put “et al.” after first author’s last name (Kaufman et al. 2008); if three authors or less, list all authors last names in same order as article.
  2. Follow Writing Guidelines on p. 3 of syllabus: (+1.25 point)
    · 1 inch margins all sides, 12 point Times New Roman font, spell-check, grammar check, page numbers, double-space, avoid contractions and passive voice, paraphrase in your own words, limit use of quotations.
  3. Short Introductory Paragraph: What are you doing? (+0.75 points)
    · Introduce the short paper (briefly describe what you are doing in paper).
    · Identify your article and be sure to give the authors names, year of publication and title.
    · Identify your final concluding argument (your assessment of what you think the article contributes in your own words). Write this after you have read the article and assessed it.
  4. Body of Paper:
    a. What is this article? Paraphrase in your own words (Limit quotes).
    · What is this article on? Use the title and the introduction to assess this. Briefly mention the topic of the article and the issue that the author is trying to address. (+0.5 points)
    · How is the author approaching the topic? Review key points from the literature review/theory sections (exact titles will vary). (+2 points)
    § What is the author’s assessment of prior literature (key gaps)? What aspects of the literature does the author focus on and why are those important?
    § What theories (if any) and how is author applying those theories?
    § How does this study contribute to the broader literature in the research area?

· What type of research did the author do? Briefly review key points on methods. (+2 points)
§ Did the research involve in-depth interviews, collected surveys, secondary data surveys (someone else collected the data), police data, etc.?
§ What is the size of the sample (20 youth, 20000 youth etc.)?
§ Where was the data collected (national sample, in one school, multiple schools in 1 city)
§ Briefly identify the core measures or topics covered.
§ Briefly, what type of analysis did the author do? (statistical analysis, analyzed themes in the interviews etc.). You do NOT need to get very specific here.

· What did the author find? Skim the results and focus most of your energy on the discussion and conclusion sections. You are looking for the author’s “big” findings (there may be many little ones too). Summarize the major findings. (+2 points)

· What are the limitations of this research? Usually the authors will mention this in the discussion and conclusion. You may also add your own assessment. (+0.5 points)

b. What do you think? (+1.25 point)
· Provide a thoughtful assessment of the article including your reactions to the research, the findings, and the quality of the work.
· What do you think this article contributes to the study of school crime?

  1. Brief conclusion: What did you do in this paper? (+0.5 points)
    · Briefly re-state what you did in the paper including the key points about the reading (very briefly) and your evaluation of it.
  2. Include Full Reference for Article in ASA format: (+0.75 points)

Sample Solution

The post SOCIOLOGY/CRIMINAL JUSTICE ARTICLE REVIEW AND CRITIC appeared first on homework handlers.

Data Analyzing & Visualization

 

DEVELOPING INTIMACY WITH YOUR DATA

This exercise involves you working with a dataset of your choosing. Visit the website, browse through the options and find a dataset of interest, then follow the simple instructions to download it. With acquisition completed, work through the remaining key steps of examining, transforming and exploring your data to develop a robust familiarisation with its potential offering:

Examination: Thoroughly examine the physical properties (type, size, condition) of your dataset, noting down useful observations or descriptions where relevant.

Transformation: What could you do/would you need to do to clean or modify the existing data to create new values to work with? What other data could you imagine would be valuable to consolidate the existing data?

Exploration: Using a tool of your choice (such as Excel, Tableau, R) to visually explore the dataset in order to deepen your appreciation of the physical properties and their discoverable qualities (insights) to help you cement your understanding of their respective value. If you dont have scope or time to use a tool, use your imagination to consider what angles of analysis you might explore if you had the opportunity? What piques your interest about this subject?

(You can, of course, repeat this exercise on any subject and any dataset of your choice, not just those on Kaggle.)

Assignment Link: http://book.visualisingdata.com/chapter/chapter-4