33 Pages

02. Basic Python

Course: CS 302 53940, Spring 2012
School: University of Texas
Rating:
 
 
 
 
 

Word Count: 2243

Document Preview

Elements CS313E: of Software Design Basic Python Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: September 3, 2010 at 08:28 CS313E Slideset 2: 1 Basic Java Acknowledgement Much of the material in this introductory slideset if from Dr. Shyamal Mitra, and used with his blessing. CS313E Slideset 2: 2 Basic Java Introduction to Python Python is a simple but powerful...

Register Now

Unformatted Document Excerpt

Coursehero >> Texas >> University of Texas >> CS 302 53940

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
Elements CS313E: of Software Design Basic Python Dr. Bill Young Department of Computer Sciences University of Texas at Austin Last updated: September 3, 2010 at 08:28 CS313E Slideset 2: 1 Basic Java Acknowledgement Much of the material in this introductory slideset if from Dr. Shyamal Mitra, and used with his blessing. CS313E Slideset 2: 2 Basic Java Introduction to Python Python is a simple but powerful scripting language. It was developed by Guido van Rossum in the Netherlands in the late 1980s. The language takes its name from the British comedy series Monty Python's Flying Circus. Python is an interpreted language unlike C or Fortran that are compiled languages. Clean syntax that is concise. You can say a lot more with fewer words. Design is compact. You can carry all the language constructs in your head. There is a very powerful library of useful funcions available. This means that you can be productive quite easily and fast. You will be spending more time solving problems and writing code than grappling with the idiosyncrasies of the language. CS313E Slideset 2: 3 Basic Java Running Python: Interactively There are several ways to run Python. >>> print "Hello World!" Hello World! This uses the read-execute-print loop. 1 2 3 4 Read in a legal Python form. Execute the form. Print the result to standard output. Go to step 1. CS313E Slideset 2: 4 Basic Java Running Python: From File For longer programs you can store your program in a file that ends with a .py extension. Example: save in a file called Hello.py is the single statement: print "Hello World!" To run your program, type at the command line > python Hello.py You can also create a stand alone script. On a Unix / Linux machine you can create a script called Hello.py containing the following lines (assuming that's where your Python implementation lives): #!/lusr/bin/python print "Hello World!" CS313E Slideset 2: 5 Basic Java Running Python: From File Let's try running this: > Hello.py Hello.py: Permission denied. What went wrong? Before you run it, you must make it into an executable file: > chmod +x Hello.py Then run it: > Hello.py Hello World! CS313E Slideset 2: 6 Basic Java Structure of a Computer Language Character set Variables Types Operators Assignments Conditionals Loops Functions Arrays Input / Output CS313E Slideset 2: 7 Basic Java Basic Syntax: Character Set Python uses the traditional ASCII character set. Recent versions also recognize the Unicode character set. The ASCII character set is a subset of the Unicode character set. Python does not have a separate character type. A character is represented as a string containing one item (e.g., "a"). CS313E Slideset 2: 8 Basic Java Identifiers Python is case sensitive. These are rules for creating an indentifier: Must start with a letter or underscore ( ) Can be followed by any number of letters, digits, or underscores. Cannot be a reserved word. Python reserved words are: False, None, True, and, as, assert, break, class, continue, def, del, elif, else, except, finally, for, from, global, if, import, in, is, lambda, nonlocal, not, or, pass, raise, return, try, while, with, yield. CS313E Slideset 2: 9 Basic Java Variables A variable in Python denotes a memory location. In that location is the address where the value is stored in memory. Consider this assignment: x = 1 A memory location is set aside for the variable x. The value 1 is stored in another place in memory. The address of that location is stored in the memory location denoted by x. This simple observation explains a lot about Python. CS313E Slideset 2: 10 Basic Java Variables and Values The values stored in variables are pointers (addresses). That's why Python variables are untyped. That's why it's OK to assign a value of "another type" to x. If you later re-assign x: x = 2.75 the value 2.75 is stored in another memory location; its address is placed in the memory location denoted by x and the memory occupied by the value 1 may be reclaimed by the garbage collector. CS313E Slideset 2: 11 Basic Java Types in Python Is it correct to say that there are no types in Python? Yes and no. It is best to say that Python is "dynamically typesd." Variables in Python are untyped, but values have associated types which may be primitive types or classes. In some cases, you can convert one type to another. Most programming languages assign types to both variables and values. This has its advantages and disadvantages. Can you guess what the advantages are? CS313E Slideset 2: 12 Basic Java Types in Python Type str Description An immutable sequence of characters. In Python 2, strings are a sequence of characters. Unicode strings need to be declared by prefixing with the letter u. In Python 3 strings are Unicode by default. An immutable sequence of bytes Mutable, can contain mixed types Immutable, can contain mixed types Unordered, contains no duplicates A mutable group of key and value pairs An immutable fixed precision number of unlimited magnitude An immutable floating point number (system-defined precision) An immutable complex number with real number and imaginary parts An immutable truth value Syntax example 'Wikipedia' "Wikipedia" """Spanning multiple lines""" b'Some ASCII' b"Some ASCII" [4.0, 'string', True] (4.0, 'string', True) {4.0, 'string', True} {'key1': 1.0, 3: False} 42 3.1415927 3+2.7j True, False bytes list tuple set dict int float complex bool CS313E Slideset 2: 13 Basic Java Operators: Arithmetic Operators These are the arithmetic operators that operate on numbers (integers or floats). The result of applying an arithmetic operator is a number. Addition: + Subtraction: - Multiplication: Division: / Remainder: % Exponentiation: CS313E Slideset 2: 14 Basic Java Relational Operators Python has 6 comparison operators. The result of applying the comparison operators is a Boolean: True or False. Equal to: == Not equal to: != Greater than: > Greater than or equal to: >= Less than: < Less than or equal to: <= You may apply the comparison operator between two operands like so (a > b). You can also apply the comparison operators in sequence CS313E Slideset 2: 15 Basic Java Boolean Operators Python has two Boolean literals: True and False. But Python will also regard any of the following as False in a Boolean context: the number zero (0), the empty string (""), the reserved word None. All other values are interpreted as True. There are 3 Boolean operators: not: unary operator that returns True if the operand is False and vice versa. x and y: if x is False, then that value is returned; otherwise y is evaluated and the resulting value is returned. x or y: if x is true, then that value is returned; otherwise y is and evaluated the resulting value is returned. CS313E Slideset 2: 16 Basic Java Assignments A variable can be assigned the value of a literal or to an expression. a b c d e f = = = = = = 1 2.3 False 5L 8 + 6j "Hello" # # # # # # 1 is an integer literal 2.3 is a floating point literal False is a boolean literal 5L is a long integer literal 8 + 6j is a complex literal "Hello" is a string literal Recall what actually goes into the variable! What do you think happens in each of these cases? An expression is composed of variables and operators. An expression is evaluated before its value used. Python allows for multiple assignments at once. x, y = y, x CS313E Slideset 2: 17 Basic Java Conditionals In Python, a conditional allows you to make a decision. You can use the keyword elif that is a contraction of the words else and if. if (cond1): ... elif (cond2): ... else: ... The body of if, elif, and else parts need to be indented. CS313E Slideset 2: 18 Basic Java Loops The loop constructs of Python allow you to repeat a body of code several times. There are two types of loops: definite loops and indefinite loops. You use a definite loop (for loop) when you know a priori how many times you will be executing the body of the loop. You use an indefinite loop (while loop) when you do not know a priori how many times you will be executing the body of the loop. To write an efficient loop structure you must ask yourself these questions: Where do I start? When do I end? How do I go from one iteration of the loop to the next? CS313E Slideset 2: 19 Basic Java While Loops Syntactically the simplest loop construct is the while loop. while (cond): ... loop_body ... What is the semantics of this construct? I.e., what does this really do? CS313E Slideset 2: 20 Basic Java For Loops A definite loop requires a loop counter which takes on a series of values. Example: write a loop that executes the body 10 times. for i in range (10): ... loop_body ... The loop counter i goes through the values 0 through 9 as the loop iterates. We can also specify the beginning and ending value of i. for i in range (3, 15): ... loop_body ... What values does i take on in this loop? CS313E Slideset 2: 21 Basic Java For Loops We can also specify the step size for the loop counter. for i in range (1, 10, 2): ... loop_body ... What values will i take on here? How would you process the sequence backwards? You can also enumerate a sequence of values for the loop counter. for i in [7, 4, 18, 12]: ... loop_body ... CS313E Slideset 2: 22 Basic Java Functions A function is an encapsulation of some functionality. Functions can be called at the top level or from within another function (or itself). A function may or may not return a value or values. The structure of a function definition is as follows: def function-name ([formal-parameters]): ... body-of-the-function ... The function-name is an identifier. You can have zero or more formal parameters, but must have the parentheses. CS313E Slideset 2: 23 Basic Java Functions The formal parameters are placeholders that accept values sent to it from the calling function. When a function is called, the parameters that are passed to it are called actual parameters. For a complete list of built-in functions see: docs.python.org/library/functions.html. CS313E Slideset 2: 24 Basic Java Function Examples def addTwo (a, b): return a + b def divide (a, b): return a / b, a % b def isEven (x): return (x % 2 == 0) def gcd (m, n): while (m != n): if (m > n): m = m - n else: n = n - m return m CS313E Slideset 2: 25 Basic Java Function Examples (2) def coPrime (a, b): if (gcd(a, b) != 1): return else: print "%0d and %0d are co-prime" % (a, b) def main(): x = 2 y = 3 z = addTwo (x, y) p, q = divide (x, y) if (isEven(z)): print z coPrime (x, y) main() What does this program do? CS313E Slideset 2: 26 Basic Java User-Defined Functions To call a user defined function that is in the same program you simply call it by name without using the dot operator. If the function does not return a value, then call it on a line by itself. If it returns values then assign those return values to variables. CS313E Slideset 2: 27 Basic Java Import Modules There are other functions that reside in modules that have to be loaded before you can use them: string, math, random, etc. You load these modules by using the import directive. import string import math, random After you load the module you can call on the functions using the dot operator. x = 7 y = math.sqrt (x) z = random.random() CS313E Slideset 2: 28 Basic Java Lists in Python The analogue of an array in Python is a list. A list is heterogenous and dynamic. What does that mean? The size is not specified at creation and can grow and shrink as needed. Python provides built-in functions to manipulate a list and its contents. There are several ways in which to create a list: enumerate all the elements create an empty list and then append or insert items into the list. CS313E Slideset 2: 29 Basic Java Lists in Python # Enumerate the items a = [1, 2, 3] # Create an empty list and append or insert a = [] a.append(1) # a = [1] a.append(2) # a = [1, 2] a.insert(1, 3) # a = [1, 3, 2] # Create a two dimensional list b = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] CS313E Slideset 2: 30 Basic Java Lists in Python (3) To obtain the length of a list you can use the len() function. a = [1, 2, 3] length = len (a) # length = 3 The items in a list are indexed starting at 0 and ending at index length - 1. You can also slice a list by specifying the starting index and the ending index and Python will return to you a sub-list from the starting index and upto but not including the end index. a = [1, 9, 2, 8, 3, 7, 4, 6, 5] b = a[2:5] # b = [2, 8, 3] CS313E Slideset 2: 31 Basic Java Lists in Python (4) One of the most important operations that you can do with a list is to traverse it, i.e. visit each element in the list in order. There are several ways in which to do so: a = [9, 2, 6, 4, 7] for item in a: print item, # 9 2 6 4 7 Other useful functions to sort, reverse, etc. lists are here: www.python.org/doc/2.5.2/lib/typesseq-mutable.html. CS313E Slideset 2: 32 Basic Java Input and Output You can prompt the user to enter a number by using function input() or a string by using the function raw input(). The function then waits for the user to enter the value and reads what has been typed only after the user has typed the Enter or Return key. n = input ("Enter a number: ") name = raw_input ("Enter your name: ") The print command allows you to print out the value of a variable. If you want to add text to the output, then that text has to be in single or double quotes. The comma (,) is used as the concatentation operator. print 'n = ', n print "name = ", name CS313E Slideset 2: 33 Basic Java
Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignAbstract Data Types Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: September 30, 2010 at 17:04CS313E Slideset 3: 1Abstract Data TypesWhat are Abstract Data Types?What is d
University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignRecursion Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: October 18, 2010 at 08:47CS313E Slideset 4: 1RecursionWhat is Recursion?Simply speaking, a recursive method is one
University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignTrees Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: November 8, 2010 at 08:40Trees r0 f r1 f T0f f f T1f f f f drfdrd f 2 T2f f f f f A (rooted) tree is composed o
University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignLinked Lists Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: November 17, 2010 at 14:33The List ADTA list is a finite sequence of elements: A1 , A2 , .An Is this structure ho
University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignTurtle Graphics Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: November 18, 2010 at 15:00Object OrientationThe basic idea of object oriented programming (OOP) and also of ab
University of Texas - CS 302 - 53940
CS313E: Elements of Software DesignMergeSort and QuickSort Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: November 30, 2010 at 15:38MergeSortMergesort runs in O(N log N) running time and the number of compari
University of Texas - CS 302 - 53940
CS 313E Midterm: Fall, 2010Version A Instructor: Dr. Bill YoungMonday, October 11, 2010Name: Read the questions carefully, and answer each question in the space provided. You may use scratch paper to do your work but only answers recorded on the test p
University of Texas - BIO 126L - 49285
BIO 205L: Laboratory Experiments in Cell &amp; Molecular BiologyBIO 206LLecture 1: IntroductionStructure and Function of OrganismsWelcome!Who is Who?Lectures 1 - 4 &amp; Course Website Lectures 5 - 8 Lectures 9 -12Dr. Moon Draper InstructorDr. Bill Allen
University of Texas - BIO 126L - 49285
9/14/10 !Lecture 2 (Week3): Brightfield, Darkfield &amp;! Phase Contrast Microscopy&quot; BIO 206L! ! Fluorescence MicroscopyBIO 205L !Structure and Function of Organisms!1 !What We Can Do with MicroscopyMicroscopy allows us to examine very small structures
University of Texas - BIO 126L - 49285
9/20/10 !To be Learned in Exercise 4!! Observation and measurement of growth kinetics! ! Be able to identify the parts of corn seedling.! ! Be able to identify stages of mitosis in prepared slides of corn seedling roots.! ! How to initiate and recognize
University of Texas - BIO 126L - 49285
Metabolic Reactions: Enzymatic Activity and Environmental Effects Photosynthesis: Chloroplast Isolation and Function Cell Respiration: Mitochondrial Structure &amp; Functionhttp:/www.worthington-biochem.com/TY/default.html!! A. William Allen! ! PAI 1.22G!
University of Texas - BIO 126L - 49285
http:/www.moleculeoftheday.com/2006/05/30/deae-diethylaminoethyl-cellulose-more-fun-with-starch/!Group Analysis 5 !! You may complete the group Analysis in the way that is easiest for you. ! ! With your normal Tuesday lab group, your new group if thing
University of Texas - BIO 126L - 49285
Extraction and Analysis of Proteins From Cells10/11/101Things to Learn in This Week's Lab1. How to extract proteins from cells.2.! How to make parallel dilutions from a stock solution. 4.! How to determine protein concentration using a standard curve
University of Texas - BIO 126L - 49285
Electrophoresis and Electroblotting of Proteins10/18/10http:/www.vias.org/science_cartoons/electrophoresis.html1MIDTERM EXAM! Monday evening ! October 25 7:30-9:00 PM ! Exercises 1-7 ! 8 AM Lecture meet in ART 1.102 ! 1 PM Lecture meet in UTC 2.112A
University of Texas - BIO 126L - 49285
Midterm Exam7:309:00 PM on Monday, October 25th 2010 8 AM Lecture the exam is in ART 1.102 (map) 1 PM Lecture the exam is in UTC 2.112A (map) 3 PM Lecture the exam is in BUR 106 (map)You MUST take the exam in the room as designated according to the Lect
University of Texas - BIO 126L - 49285
11/3/2010DNA Bioinformatics Extraction of Plasmid DNA Extraction of Genomic DNAWhat You Will Learn from This Class-DNA Bioinformatics The Alkaline Lysis Mini-Prep Procedure to Mini Prep Isolate Plasmid DNA from Bacterial Cells Quick Extraction of Genomi
University of Texas - BIO 126L - 49285
11/8/2010Things to Learn From This Week's LabPolymerase Chain Reaction (PCR) GENETIC ENGINEERING OR RECOMBINANT DNA TECHNOLOGYPolymerase Chain Reaction to Amplify Large Quantities of DNA in a Few Hours How to use restriction enzymes to cut DNA in speci
University of Texas - BIO 126L - 49285
11/15/2010List for these couple of weeks Get ready for final Complete evaluations for LORs and LIs Provide feedback on both teaching and course improvementsSELECTION AND ANALYSES OF TRANSFORMED BACTERIA AGAROSE GEL ELECTROPHORESIS ANALYSES OF RESTRICTI
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Lab 1 Measuring Devices Which of the following devices is appropriate to measure the stated quantity? 1. 23.4 g NaCl a) analytical balance b) two-pan balance c) top-loading balance 2. 5.4 ml water a) blow-out pipette b) graduated cylinder
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Labs 2 and 3 Types of Microscopy For each specimen listed below, describe which technique (brightfield, darkfield, phase contrast, fluorescent microscopy) you would use to visualize it. 1) An unstained, live amoeba2) Genetic material in
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Lab 4 Population Growth Kinetics What do we mean by positive growth kinetics?A pure culture grown under optimal conditions exhibits four distinct phases of growth. Name each phase and describe why it occurs.The mathematical equation for
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Lab 5 Development Describe the main stages of sea urchin developmentDescribe the main stages of corn seedling development.Except in rare cases, no more than one sperm is able to fertilize an egg. Describe the cellular mechanisms that pr
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Lab 6 Separation Science True or False: 1) The higher the Rf of a band on a silica TLC plate, the more polar the molecule in that band 2) Using a DEAE-cellulose column with Tris buffer as the eluant, a more negatively charged particle wil
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Labs 7, 8, and 9 Protein Extraction When proteins are to be extracted from whole cells, several experimental protocols must be followed to preserve protein structure insofar as possible. Please explain the purpose of each of the following
University of Texas - BIO 126L - 49285
REVIEW QUESTIONS Labs 10, 11, and 12 PCR The parameters for a PCR you are running are listed below. Explain the significance of each temperature, and why PCR is a chain reaction. 94 C 94 C 55 C 72 C 4 CYou have a DNA sample containing 5000 copies of a se
University of Texas - BIO 126L - 49285
Review Exam covers (Lots of stuff) Making solutions Microscopy Population kinetics Chromatography Urchin and root embryonic development Protein Extraction Protein electrophoresis &amp; Western Blotting Plasmid Ligation and Bacterial Transformation Isolation
University of Texas - BIO 126L - 49285
11/30/2009BIO 205L Review Exam covers Western Blotting Isolation of Plasmid DNA Plasmid Ligation and Bacterial Transformation Ligation and Bacterial Transformation Analysis of Restriction Digestion of Plasmid DNA Polymerase Chain Reaction Protein &amp; DNA
University of Texas - BIO 126L - 49285
The following is a list of some procedures/concepts which to be familiar for the Bio205L practical exam. Note: it is NOT all-inclusive. Lab safety rules knowledge and demonstration of good laboratory practices Use of safety equipment / supplies gloves, go
University of Texas - CS - 334
Navigating CyberspaceIntroduction to Cyberspace Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: January 17, 2011 at 09:09What is Cyberspace?The word cyberspace was coined by science fiction novelist William Gi
University of Texas - CS - 334
Navigating CyberspaceSimple HTML Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: January 20, 2011 at 14:50HTTPTo view a Web page on the World Wide Web: You type a URL into your browser or click on a hyperlink.
University of Texas - CS - 334
Navigating CyberspaceSignals Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: January 26, 2011 at 11:56Analog vs. DigitalThere are two distinct ways of representing information. Analog: a continuously varying w
University of Texas - CS - 334
Navigating CyberspaceElementary Information Theory Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: February 10, 2011 at 08:57What is Information?In this class we're concerned about the flow of information in C
University of Texas - CS - 334
Navigating CyberspaceThe Internet: Preliminaries Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: February 10, 2011 at 15:40Very Brief History of the InternetIn 1969, the Advanced Research Projects Agency (ARPA
University of Texas - CS - 334
Navigating CyberspaceThe Internet: Physical and Link Layers Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: February 23, 2011 at 11:49OSI Layered Architecture ModelRecall that the OSI Reference Model is an abs
University of Texas - CS - 334
Navigating CyberspaceThe Internet: The Network Layer Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: March 9, 2011 at 06:38OSI Layered Architecture ModelRecall that the OSI Reference Model is an abstract chara
University of Texas - CS - 334
Navigating CyberspaceThe Domain Name System Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: March 2, 2011 at 15:39Solving a ProblemDNS is like the &quot;phone book&quot; of the Internet. Like so much else on the Interne
University of Texas - CS - 334
Navigating CyberspaceThe Transport Layer Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: March 23, 2011 at 08:41OSI Layered Architecture ModelWe continue traveling up the OSI Reference Model stack, stopping th
University of Texas - CS - 334
Navigating CyberspaceWWW and HTTP Dr. Bill Young Department of Computer Sciences University of Texas at AustinLast updated: April 29, 2011 at 08:28OSI Layered Architecture ModelWe end our tour of the OSI Reference Model stack at the top, the Applicati
University of Texas - CS - 334
CS329E Quiz 1: February 14, 2011 Name:Note that this quiz has two sides. 1. (5 points) Explain as clearly as you can the difference between an analog and a digital representation of information. An analog representation uses an analogy to represent a rea
University of Texas - CS - 334
CS329E Quiz 2: February 23, 2011 Name:Note that this quiz has two sides. Each question is worth 2 points. 1. Briefly explain what a protocol is. A protocol is a structured dialogue among two or more parties in a distributed context controlling the syntax
UNSW - ACCT1511 - 1511
Australian School of Business School of Accounting ACCT 1511 Accounting and Financial Management 1B Session 1, 2009 Week 8 Corporate Governance and Professional EthicsStudent HandoutLecturer: Leon Wong Website: http:/vista.elearning.unsw.edu.au1Introd
UNSW - ACCT1511 - 1511
Suggested solutions to workshop questions(1)Read Qantas 2007 Corporate Governance Report and Board member biographies(http:/www.qantas.com.au/info/about/corporateGovernance). Identify and discussthe corporate governance relevance of the following:(a)
UNSW - ACCT1511 - 1511
Australian School of BusinessSchool of AccountingACCT 1511Accounting and Financial Management 1BSession 1, 2009Week 9Introduction to Management AccountingandCost ConceptsStudent HandoutContents:1.Learning Objectives2.Tutorial Questions3.Le
UNSW - ACCT1511 - 1511
School of AccountingACCT 1511: Accounting and Financial Management 1BSession 1, 2009Week 10Cost Behaviour and CVP AnalysisStudent HandoutContents:1.Learning Objectives2.Tutorial Questions3.Lecture MaterialsLecturer:Leon WongWebsite: http:/v
UNSW - ACCT1511 - 1511
School of AccountingACCT 1511: Accounting and Financial Management 1BSession 1, 2008Week 11Costing SystemsStudent HandoutContents:1.Learning Objectives2.Tutorial Questions3.Lecture MaterialsLecturer:Leon WongWebsite: http:/vista.elearning.u
UNSW - ACCT1511 - 1511
Australian School of BusinessSchool of AccountingACCT 1511Accounting and Financial Management 1BSession 1, 2009Weeks 6 to 7Introduction to Financial Statement AnalysisandAccounting Policy ChoiceStudent HandoutContents:1.Learning Objectives2.
UNSW - ACCT1511 - 1511
SURNAME OF CANDIDATE:FIRST NAME OF CANDIDATE:STUDENT ID:SIGNATURE:Official Use OnlyQMark12SCHOOL OF ACCOUNTING34ACCT 1511:Accounting and Financial Management 1B5Total(/80)FINAL EXAMINATIONJune 2007Time Allowed:Reading Time:Total Numbe
UNSW - ACCT1511 - 1511
SURNAME OF CANDIDATE:FIRST NAME OF CANDIDATE:STUDENT ID:SIGNATURE:Official Use OnlyQMark123SCHOOL OF ACCOUNTING4ACCT 1511:5Accounting andFinancial Management 1B67FINAL EXAMINATIONSemester 1, 20088Total(/75)Time Allowed:Reading Time
UNSW - ACCT1511 - 1511
SURNAME OF CANDIDATE:FIRST NAME OF CANDIDATE:STUDENT ID:SIGNATURE:Official Use OnlyQMark12SCHOOL OF ACCOUNTING34ACCT 1511:Accounting and Financial Management 1B56Total(/75)FINAL EXAMINATIONNovember 2007Time Allowed:Reading Time:Total
UNSW - ACCT1511 - 1511
SURNAME OF CANDIDATE:FIRST NAME OF CANDIDATE:STUDENT ID:SIGNATURE:Official Use OnlyQMark12SCHOOL OF ACCOUNTING34ACCT 1511:Accounting and Financial Management 1B56Total(/75)FINAL EXAMINATIONOctober/November 2008Time Allowed:Reading Tim
UNSW - ACCT1511 - 1511
Important note relating to past final examination papersFinal examination papers and solutions for the last four sessions areprovided here for your reference.These materials will be useful in your preparation for this sessions finalexamination. You sh
UNSW - ACCT1511 - 1511
School of AccountingACCT 1511: Accounting and Financial Management 1BSession 1, 2009Week 3Cash Flow StatementsStudent HandoutContents:1.Learning Objectives2.Tutorial Questions3.Lecture MaterialsLecturer:Peter LamWebsite: http:/vista.elearni
UNSW - ACCT1511 - 1511
Budgeting for planning and controlACCT 1511Session 1, 2009Week 12O1O2Behavioural aspects of budgetingaspects of budgetingO3Master budget and its componentsO4Budgeting forPlanning &amp; ControlWhat is a budget?Why and how is it used?Case study2
UNSW - ACCT1511 - 1511
AnnouncementsSTUVAC Consultation Hours Your pre-Final Exam mark on Vista onStaffDateTimeRoomLeonJune 11 (Thu)10-12 AMQuad 3063Monday, June 8SarahQuad 30892-4 PMQuad 3089JuneJune 12 (Fri)Fri)10 12 AM10-12 AMQuad 3069JuneJune 12 (Fri)
UNSW - ECON2101 - 2101
Econ 2101: Microeconomics Theory 2Practice Final ExamsBelow are two separate sets of problems. Each set constitutes a practice exam for thefinal. Of course, neither set is an exact replica of the final, or represents an exactcoverage of the topics tha
UNSW - ECON2101 - 2101
The ProblemCostsProduction function: y = f(x1,x2).Take the output level y 0 as given.1. Cost Minimization (Ch 20)2. Cost Curves (Ch 21)Given the input prices w1 and w2, thecost of an input bundle (x1,x2) isw1x1 + w2x2.WEEK 6-1The Problem (contd.
UNSW - ECON2101 - 2101
Short-run total costsThe short-run cost-minimization problem isCostsmin w 1x1 + w 2x 2x1 0f ( x1 , x ) = y .21. Cost Minimization (Ch 20)2. Cost Curves (Ch 21)Note x2 is fixed at x2 = x2WEEK 6-2Short run costs: an exampleECON2101S1 2009Shor
UNSW - ECON2101 - 2101
Exercise: Cost functionThere are 100 firms in the widget industry,and they are are all alike.Each firms production function is given byUntil Monopolyy = mincfw_ x1 , x2 A1: Find MP of x1 and x2.A2 CheckA2. Check that the production fn exhibitsdec
UNSW - ECON2101 - 2101
Things to doProfit maximization: MarginalRevenue = Marginal CostInefficiency of monopoly anddeadweightdeadweight lossMonopoly pricing and elasticity ofdemanddemandTaxMonopolyChapter 24Sections 1 - 5Profit tax (a % of profit is taxed)Quantity
UNSW - ECON2101 - 2101
Technology and ProfitMaximizationInstructor: Dr. Arghya Ghosh(a.ghosh@unsw.edu.au)Office Hours: Wed, 1pm 4pm, ASB 406Weeks: 5 8, 11-12Theme: Production, Firms, Market StructureChapter 18: TechnologyChapter 19: Profit MaximizationTechnologyTechno
UNSW - ECON2101 - 2101
Profit maximizationChapter 19, VarianPreliminariesOutput level y = f(x1,x2)Product price pRevenue = py = pf(x1,x2)Inputs: x1,x2.Input prices: w1,w2.Costs = w1x1 + w2x2Profits = Revenue Costs= pf(x1,x2) - w1x1 - w2x2WEEK 5-2ECON2101S1 2008Max