APL with a Mathematical Accent
eBook - ePub

APL with a Mathematical Accent

  1. 224 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

APL with a Mathematical Accent

Book details
Book preview
Table of contents
Citations

About This Book

This book should be of interest to mathematics scientists working in the areas of linear algebra, abstract algebra, number theory, numerical analysis, operations research and mathematical modelling.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access APL with a Mathematical Accent by C.A. Reiter in PDF and/or ePUB format, as well as other popular books in Mathematik & Mathematik Allgemein. We have over one million books available in our catalogue for you to explore.

Information

Publisher
Routledge
Year
2018
ISBN
9781351466332
਀਀
APL
With a Mathematical Accent
CHAPTER
1
First Steps with APL
Chapter One begins by discussing how to interact with APL and interpret basic APL statements. It gives several familiar mathematical functions and their APL denotations. It also introduces some of APL’s powerful vector processing capabilities and special functions. Finally, the chapter briefly discusses some facts about the APL work environment and its management.
1.1 Interacting with APL
Using APL can be somewhat like using a calculator. You enter data or commands, and APL responds. If you enter 3 + 2, for example, the response is 5. The ongoing exchange between you and APL is recorded on paper or on a video screen. The record, or session log, of a few arithmetic problems could look like this:
Image
The APL response begins at the left margin on the line below your entry. After the response there is an automatic advance to the next line and a six-space indent; then APL is ready for further input. This format makes it easy to distinguish your input from APL’s response. This book has several small examples from a session log that are printed across the page like this:
Image
1.2 Order of Execution
Common mathematical notation has rules governing the order in which mathematical operations are performed. For example, multiplication and division take precedence over addition and subtraction. The commonly used rules interpret 3 X 4 –5 as 12–5, not 3×(–1) and 2+6÷3 as 2+2, not 8+3. Conventions for interpreting more complicated expressions such as sin2ab also exist, but they are intricate to codify and can lead to ambiguous expressions when many functions are involved.
APL has but one rule governing the order of function execution within APL expressions. There is no hierarchy of functions with some taking precedence. The resulting simplicity is especially important because APL has many primitive (built-in) functions. Simply expressed the rule is
APL functions are executed in order from right to left.
Note that the rule is that you start at the right and work to the left. For example, the APL interpretation of the expression 3 × 4 + 5 is as follows: First add the 4 and 5 to get 9 (the rightmost function is +), then multiply 9 by 3 to get 27. Thus, the APL evaluation of 3×4 + 5 is 27. As with conventional mathematical notation, expressions may be grouped with parentheses; the right-to-left rule also applies within the parentheses.
Here are some examples; note the effect of parentheses:
Image
The order of execution rule applies to all functions; here are examples with the power function or exponentiation, denoted*:
Image
Roots are treated as fractional powers in APL; for example,
Image
1.3 Negative Sign, Minus Sign
Negative numbers are indicated with a high minus sign; for example, 2. Note the difference in position between the minus sign that indicates the arithmetic function subtraction, as in 3−5, and the APL negative sign that serves as part of the symbol denoting a negative number, as in 2. Here are examples:
Image
1.4 Assignment and Variable Names
APL variables are given values by assignment, which is symbolized with a left-pointing arrow as in A←5. When you enter A ← 5, 5 is stored with the name A, the automatic advancement and indentation occurs in the session log, and APL awaits your next entry. After a variable has been assigned a value, entering that variable name alone results in the display in the session log of the current value of the variable. A new assignment to a variable name replaces any value formerly stored with that name. Here is a sample session log:
Image
APL displays the result of the last function applied in a line unless the last operation is assignment.
Multiple assignments are convenient; for example, K← J←1 would assign both K and J the value 1. The expression F←2+E←D×D←3 would assign the values 3, 9, and 11 to the variables D,E, and F, respectively.
More suggestive variable names can be helpful; for example, to find the area of a rectangle,
Image
A letter followed by any combination of letters and numerals is a valid variable name; typically, systems allow up to 77 characters in a name. Thus, AA, B14C, X5Y05, Z3TERM, and MOON are valid variable names. Modern systems usually have uppercase and lowercase alphabets, permitting ample flexibility in constructing names.
1.5 Example: Heron’s Formula
Suppose A,B, and C are the lengths of...

Table of contents

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Dedication
  6. Table of Contents
  7. CHAPTER 1 First Steps With APL
  8. CHAPTER 2 Fundamentals of Arrays
  9. CHAPTER 3 Elementary Function Definition
  10. CHAPTER 4 Matrix Algebra
  11. CHAPTER 5 Data Comparison and Logical Functions
  12. CHAPTER 6 Simulation and More Mathematical Functions
  13. CHAPTER 7 Statistics and Graphics
  14. CHAPTER 8 More Array Manipulation
  15. CHAPTER 9 Sorting and Coding
  16. CHAPTER 10 More Function Definition
  17. APPENDIX A Help Error Messages, and Debugging
  18. APPENDIX B Workspace Environment
  19. APPENDIX C Keyboards
  20. APPENDIX D Answers to Selected Exercises
  21. Bibliography
  22. References
  23. Index