Sep 17, 2013

Notes for Think Again: How to reason and argue (Lectures 1 to 2)

These are my course notes for the Coursera course "Think Again" by Walter Sinnott-Armstrong at Duke University and Ram Neta at University of North Carolina.


  • There are four parts to reasoning and arguing effectively:
    1. Analyzing arguments: Which parts contain arguments? Which parts contain premises and which contain conclusions? We separate and order every part of an argument and supply missing parts or suppressed premises.
    2. Evaluate deductive arguments: Deductive arguments are valid logically, and can can be propositional or conditional. They are usually derived (or established) from a set of known facts or observations.
    3. Evaluate inductive arguments: Inductive arguments do not try to be logically valid, but does not make them less effective arguments. They use generalizations, inferences, analogies and causalities to make their case.
    4. Identify fallacies: Fallacies in arguments include vagueness, ambiguity, begging the question (basing a conclusion on a premise that needs just as much proof as the conclusion itself), irrelevance and ad hominem.
  • Arguments are an intellectual process. It is asserting your views and giving reasons for your views. In other words, and argument is a connected series of statements intended to establish or understand a definite proposition.
  • Arguments are NOT:
    • Fights
    • Abusive
    • Complaints
    • Contradictions or disagreements
  • Arguments ARE:
    1. a series of sentences, statements or propositions
    2. where some are premises
    3. and one is the conclusion
    4. where the premises are intended to give a reason for the conclusion
  • It is important to understand the purpose of an argument, as it will help understand the argument itself. Some reasons for an argument are:
    1. Persuasion: Making people believe or do something you would not ordinarily do (and these can include bad reasons).
    2. Justification: Showing someone a reason to believe a conclusion. They generally try to give good reasons as they are not intending to persuade you to change your belief.
    3. Explanation: Arguments meant to explain a situation or event. The conclusion is already known to be true, so we are trying to find the reasons or premises for the conclusion. Note that explanation does not necessarily lead to prediction, and predictions do not necessarily lead to explanation.

      There are four types of explanations:
      1. Causal: Why did something happen? Find the external causes.
      2. Teleological: For what purpose did something happen? What was the motive behind the act?
      3. Formal: Scientific or logical reason behind the act, usual based on the "design", "form" or "shape" of the object. This is different from Causal because it is an internal cause within the event.
      4. Material: The reason based on the physical composition of the object.
    4. Understanding: A strong argument will not necessarily be a persuasive one. But arguments are meant to clearly communicate what one thinks and why they think it. So a benchmark for arguments is not complete persuasion but how clearly one is understood.
  • In arguments, Language is:
    • Important: it is especially hard to live without.
    • Conventional: General pattern of communication that people use.
    • Representational: It refers to objects and facts.
    • Social: Conventions are shared and understood.
  • Parts of language include:
    • Semantics: meaning of words.
    • Physical production: volume and pronunciation
    • Structural combination: spelling and grammar
    • Etiquette: politeness and manner (not yelling, for example)
  • A word's meaning is mainly determined by how it is used.
  • We can split communication into the following:
    • Linguistic act: meaningful utterances. Only requires meaningful words, grammatical structure and that the relationships between words makes sense.
    • Speech act: A function of language that aim to inspire or convey a desired action in the world, even if that action does not occur. We take words and impose them on the world as long as they occur in the right circumstances (and attitudes help determine the circumstances in which a speech act is performed). Speech acts include promising, apologising, questioning, threatening, inviting etc.

      Note that a speech act is present tense. It denotes something occurring, not already been or could be done without the words being spoken.
    • Conversational act: Intends to bring about a change or intended effect in the world or belief, which is the standard effect for the kind of speech act that the speaker is performing. A conversational act does not occur if the resulting effect does not occur. Answering is a conversational act bought about by the speech act of questioning, and forgiveness is a conversational act bought about by the speech act of apology.
  • Arguing is a speech act.
  • Grice's rules for a co-operative conversation are:
    • Quality: Don't say what you don't believe or have no reason to believe.
    • Quantity: Don't say too much or too little.
    • Relevance: Be relevant.
    • Manner: Be brief, orderly, avoid obscurity and ambiguity. It is all about style.
  • Breaking or violating the rules for co-operative conversation are generally for deceiving people.
  • We can infer, following Grice's rules, the missing pieces of a statement. This process is called Conversational Implication; note that this is not logical implication! For instance, Mary had a baby and got married implies Mary had her baby first and then got married but the reversing the order of statements can strictly be true too. Depending on the intentions of the speaker they may be trying to deceive the listener by violating the Manner rule and confusing the order of events.
Lecture 2
  • Certain words imply certain meanings, and can be used to imply some sentences as reasons or conclusions for another. These words are called Argument Markers.
  • Two types of argument markers:
    • Conclusion markers indicate the sentence after is a conclusion. So, therefore, thus, hence, accordingly.
    • Reason/Premise markers indicate that the sentence after is a reason for the prior sentence. Because, for, as, since.
  • The presence of an argument marker does not always mean an argument is present; it depends on context. For instance, since can also be used in a temporal sense.
  • A good indicator for the presence of an argument is to substitute another suitable argument marker in it's place while still making the sentence comprehensible.
  • If is not an argument marker; it is a conditional statement (only if it asserts, then it can be an argument marker).
  • Standard form of arguments:
    (1) Premise
    (2) Premise
    __________
    ∴ (3) Conclusion (from 1-2)
  • Need to justify the belief in the premise to justify the belief in the conclusion.
  • Skeptical regress raises the question of whether and how any belief can be justified or known. Since no belief can be absolutely justified, this can result in infinite loops or unending arguments.
  • Tricks for dealing with skeptical regress include:
    • Assuring by appealing to an authority or shared assumptions.This is based on trust. The full evidence has not been cited because it is already known or has been verified by an authoritative source. We have limited time, so we cannot prove everything so we utilise a trusted source instead.
    • Discounting objections by citing them and cutting them out quickly. It shows you have already considered the objection, but other qualities or claims are more important. The speaker would use discounting terms such as but, although, even if, whereas and still. You would still use the substitution method to determine if a word is being used as a discounting term.
    • Guarding your claim by making it weaker, not definitive or acknowledging doubt. This makes it harder to object to your claim (and more likely to be true), and move focus to more important claims. 
  • Three types of assurances:
    • Authoritative: Cite but not give the actual evidence.
    • Reflexive: Talking about yourself and your own mental state.
    • Abusive: Abuses you or your argument. Common example is an appeal to common sense.
  • People can use assurances to trick you by citing untrustworthy sources, using it as a distraction, or dropping assurances.
  • The three types of guarding are:
    1. Extent: Size or scale of claim
    2. Probability: Likelihood or certainty of occurrence of claim.
    3. Mental: Your personal mental state, belief or knowledge of claim.
  • Discounting words do three things:
    1. Assert two claims
    2. Contrast claims
    3. Indicate one claim is more important than the other
  • Evaluating terms is used to paint a claim in a positive or negative light. Note that expressing a preference is not making an evaluation.
  • Good => meets the standards
    Bad => violates the standards
  • Ought/Ought Not, Should/Should Not, Right/Wrong are all evaluating terms.
  • Evaluative language is openly and literally evaluative irrespective of context.
  • Slanting is using evaluative language without having a reason for the evaluation.
  • Close analysis is going through an argument and marking it for terms and words that indicate conclusion/premise markers, assurances, discounting terms, guarding and evaluative terms. You can use the following markers to indicate these terms:
    • R/P = reason/premise marker
    • C = conclusion marker
    • A = assuring term
    • G = guarding term
    • D = discounting term
    • E+ = positive evaluation
    • E- = negative evaluation
    • N = nothing/neutral

This is an excerpt from one of my comments in the class Forum regarding the differences between the four types of explanation arguments:
From my understanding....
1) Causal are external events that impact on the one under observation (basing this on the idea of causality)
2) Teleological are the aims or purposes of the actor driving the event (if there is one)
3) Formal are the causes based on the design, positioning, form or shape. This is different from causal as we are looking within the event itself, not external phenomena. This can include scientific laws such as gravity etc.
4) Material are causes based on the physical composition of the object itself.
So for the nuclear explosion in hiroshima:
- Causal is an aeroplane over Hiroshima dropping an atomic bomb wired for explosion upon impact. This is the external event that leads to the explosion at Hiroshima.
- Teleological is the USA using the atomic bomb to devastate Japan and quickly end WW2. This is a simplification of the goals behind the explosion at Hiroshima.
- Formal will be the details explaining how, upon impact, the trigger mechanism sets off the fuel material to create a nuclear explosion. We are looking at the causes within the event itself, which is the bomb going off.
- Material is explaining how the material reacts explosively to certain phenomena due to it's inherent instability at the atomic level. We are looking at the phenomena that at the center of an atomic bomb; if this was a conventional bomb we would be explaining how gunpowder works.

Sep 7, 2013

AJAX with JQuery and Google App Engine: Python

This is an adaption of AJAX with JQuery and PHP. It is a continuation of my Python 2.7 and Google App Engine series, and portions of the code builds upon my earlier work.

A first example...

AJAX stands for Asynchronous JavaScript And XML, and allows us to make our websites seem more dynamic. Let's start with the JavaScript side of things...

Create a file called static.html and add the following:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
       <title>Ajax With Jquery</title>

       <!-- Grab the JQuery API from the Google servers -->
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" charset="utf-8"></script>

       <!-- Our own JQuery code to do the AJAX-y stuff -->
       <script type="text/javascript" charset="utf-8">

          $(document).ready(function(){
             $('#txtValue').keyup(function(){
                 $('#display').html($(this).val());
             });
          });

       </script>
    </head>

    <body>
       <label for="txtValue">Enter a value : </label>
       <input type="text" name="txtValue" value="" id="txtValue">

        <div id="display"></div>
    </body>
</html>

Create a file called app.yaml and add the following:
application: almightynassar
version: 1
runtime: python27
api_version: 1
threadsafe: yes

handlers:
- url: /(.*).html
  static_files: \1.html
  upload: (.*).html

The above will simply serve ALL html page requests directly (which is enough for this example).

Now, if you are using Eclipse just right click on the project, select 'Run As' and choose the 'PyDev: Google App Run' option. Depending on how you configured your Google SDK, it will start up a server on your machine on port 8080. Open up a new tab and navigate to http://localhost:8080/static.html. You should now see a text box; when you type into the box it will automatically display the text in the space below.

Something a little more AJAX - The HTML

So our original example just showed how we could manipulate the DOM (Document Object Model) of the browser during run-time, without a page refresh. How can we use this knowledge utilizing the power of Google App Engine? Well, first let us edit static.html to something we can manipulate:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
       <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
       <title>Ajax With Jquery</title>
     
       <!-- Grab the JQuery API from the Google servers -->
       <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" charset="utf-8"></script>

       <!-- Our own JQuery code to do the AJAX-y stuff -->
       <script type="text/javascript" charset="utf-8">
       $(document).ready(function(){
            // This will run when the item of class 'button' is clicked
            $(".button").click(function() {
               
                // Grabs the text input
                var name = $("input#txtValue").val();
        
                var dataString = 'txtValue='+ name;  
                // This creates the AJAX connection
                $.ajax({
                    type: "POST",
                    url: "/tutorial",
                    data: dataString,
                    success: function(data) {
                        $('#display').html(data.text);
                    }
                });
            return false;
            });
        });
       </script>
    </head>

    <body>
         <form name="contact" method="post" action="">
            <label for="txtValue">Enter a value : </label>
            <input type="text" name="txtValue" value="" id="txtValue">
            <input type="submit" name="submit" class="button" id="submit_btn" value="Send" />
         </form>
         <div id="display">
         </div>
   </body>
</html> 

Our JavaScript now sends some data to an external URL (in this case /tutorial) and inserts the returned data into the display div. Now all we need to do is code our Python script....

Our Python webapp

Create a file called tutorial.py and add the following code:

# The webapp2 framework
import webapp2

# The JSON library
import json

# Our JSON handler class
class JsonPage(webapp2.RequestHandler):
    # The POST handler
    def post(self):
        # Our POST Input
        txtinput = self.request.get('txtValue')
       
        # Create an array
        array = {'text': txtinput}
       
        # Output the JSON
        self.response.headers['Content-Type'] = 'application/json'
        self.response.out.write(json.dumps(array))

# URL map the JSON function
app = webapp2.WSGIApplication([('/tutorial', JsonPage)], debug=True)

Now we just need to edit app.yaml so it can serve up our tutorial script:

application: almightynassar
version: 1
runtime: python27
api_version: 1
threadsafe: no

handlers:
- url: /(.*).html
  static_files: \1.html
  upload: (.*).html

- url: /(.*)
  script: tutorial.app

Open up a new tab and navigate to http://localhost:8080/static.html. You should now see a text box with a button called 'Send'. Typing into this box and then clicking 'Send' will transmit the text to our tutorial script and then display the text in the space below.

References: