Maths ... https://postbox22.com

Calculating
with Linux

by Wal Baker

<>

Learn the code to save the net!


This tutorial is for Linux users who want to learn and practise mathematics on a command-line calculator. It covers maths from year seven to year 12 of high school. It is written for anybody aged 10 and up. It can be used with school text books for a better understanding of maths. Anybody who already knows how to use Terminal with a Linux operating system has a head start.

The tutorial also covers how to use calculator software programs. Lessons in this tutorial apply to many different calculator programs. Search this page for the name of a Linux or cross-platform calculator or for any term in mathematics.

Here at a glance are some of the terms covered by this tutorial:
logarithm sum Calc Wcalc square root power indice sqrt sin cos tan avg max min log pie function equation divide var multiply fraction expression exponents negative positive add subtract matrix tangent Gcalccmd Kcalc decimal variable exponential algebra arithmetic unknown Terminal brackets parentheses pronumber pronumeral numerator denominator true false memory ratio percentage interest rate trapezium radius triangle diagonal formula cylinder rectangle triangle base volume convert cube cone sphere degree angle bearing comment equalise mean mode Gcalc markup speed distance time velocity calculus derivative acceleration decelerate displacement hypotenuse acute opposite sine cosine right-angle adjacent trigonometry radians radii segment Gnome LibreOffice scientific spreadsheet AC BC Linux average tenth price dollar gui graphic surd transcendental integers rationals series endless cubic simplify quadratic factorise avg hypot ilog polynomial coefficient round log co-ordinate axis horizontal vertical slope gradient direction parallel graph curve convex concave secant point pi notation inversion area table label median statistics engineer mode money array column row sigma histogram pipe line compass protractor ruler chart outlier distribution standard deviation spread variance zero rounded real complex imaginary radical mathematics maths set geometry term series digit basic undefined probability favourable outcomes sure certain sample unlikely random pattern ordered rule plotted SC edit merge.

Search this tutorial for any mathematical term and learn about it by reading the instructions and practising the examples on a calculator.

Or just start working through the tutorial from beginning to end.

Do not alter this document as it is written, edited and formatted in a style meant for teaching Linux users who copy and paste data into the command lines of calculators.

Save this page from the internet to your computer. Open the page in a plain text editor like Gedit or Vim, not a word processor nor a web publisher.

To use the tutorial at any time:
Open this web page in a plain text editor.
Drag the editor to the right side of the page.
Run the command Terminal on the left side of the page.
Run a calculator like Calc from the terminal.
Copy commands and data from the tutorial to the command line of the calculator.

Read the instructions in the tutorial, follow the examples and do the exercises to learn maths with a calculator.

Tutorial

This tutorial works in a plain text editor.

Calc and Wcalc, a cross-platform calculator, can be installed on Linux operating systems. Calc is good for students learning to understand maths. Wcalc is a good scientific or engineering calculator. Both work from a Terminal command line much the same as each other.

Some symbols read by Calc + - * / ^ < > ( ) ^/ = sum But = is read only to store a value in memory. Calc does not read the signs = $ [] % sqrt sin cos tan avg max min log pie But it can solve a function or equation by arithmetic as shown below.

To start the calculator, open a terminal window and run the command calc: username@username-number:~$ calc C-style arbitrary precision calculator (version 2.12.7.2) Calc is open software. For license details type: help copyright Type "exit" to exit, or "help" for help.]

To read about how to use Calc, run a help command: help or help usage or show or show builtins

Press return or enter instead of = after a sum to show the answer.

To do a sum: at the semicolon ; command line, type a sum without an = sign and press the enter key. eg ; 2+2 enter 4 ; 3*5 15 ; 9/2 4.5 ; 6-9 -3 ; 18/3= Illegal assignment

; Calc did not recognise the = equal sign in that last sum.

To use the number keypad, press the numlock key on.

Calc uses the forward stroke as a division and fraction line. So ... ; 18/3 6 ;

There 18 is divided by 3. Or 3 is divided into 18. The number being divided into goes on top of the fraction or before the slash. The number dividing into it is 3. That goes at the bottom of the fraction or after the slash. The top number is divided by the bottom number.

To add a list of numbers, run the sum command in Calc: ; sum (2+5+6+1) 14 ;or 2+5+6+1 = 14 Neither Calc nor Wcalc recognise the sum command.

To divide numbers: ; "Divide 12 by 6" ; 12/6 2 ; "Divide 6 into 12" ; 12/6 2 ; Three squared is ; 3*3 9 Two to the power of 4 is ; 2*2*2*2 16 Calc reads ^ to mean to the power of. ; 3^3 27 ;

To calculate the square of a number: ; 1.89872351612187101312 ^10 ~608.99999999999999999312 ;There the number is 1.9 to the power of 10 = 609.

Powers are shorthand for writing more complex expressions and equations. An equation has an = equal sign in it, an expression does not. Powers are sometimes called indices or exponents. Logarithms are indices.

eg The logarithm or index of 1000 in the base of 10 is 3, that is 10^3.

A logarithm is the number of times a number is multiplied by itself to make another number. In the sum 2*2*2=8 the logarithm is 3. ; 2^3 8 ;

So the logarithm of 8 with base 2 is 3. The base is the number being multiplied.

eg How many 5s are multiplied to get the answer 625. Try 5^4 ; 5^4 625 ;

There 5 is the base and 4 is called the exponent, to the power of 4.

eg What exponent makes 10 into 100? Try exponent 2. ; 10^2 100 ;

Pocket calculators have a log button which usually uses a base of 10 and a ln button which uses base e.

Natural logarithms use base e, e for variable exponential. How many times is 10 multiplied to get the answer 1000 when the base10 logarithm is 3? That means 3 times. ; 10^3 1000 ; How many times is 10 divided to get 0.001. That would be 3 10s. ; 10^-3 0.001 ; The base10 logarithm is -3. Answers below 0 are - negative.

Calc does not read e as meaning to the power of anything.

A common logarithm has a base 10, log10. To find the common logarithm of a number: type the number into a pocket calculator then press the log button. What is the log of number 576.4 ? log 576.4 Kcalc says 2.76 log 576.4 = 2.76

Kcalc scientific calculator gives the logarithm for a number. To show the logarithm for the base of 10, type a number then press the Log button. To show the natural logarithm for a number, type the number then press the ln button.

To multiply or divide by 100 by moving the decimal place: Calc uses the e key. ; 2e2 200 ; That expression means take 2 and move the decimal place two to the right. ; 3.696e10 36960000000 10-3 existing decimal places adds 7 zeros. ; 2.0e2 200 ; 2.5347e2 253.47 ; That moves the decimal dot two to the right.

To shorten a long decimal to two places: e-2 ; 2419e-2 24.19 ;

To change a fraction to a decimal and multiply it by 100: 2/7 ~0.28571428571428571429 2/7e-2 ~28.57142857142857142857

To divide a decimal by 100: ; 2/7e2 ~0.00285714285714285714 ;

To divide a fraction by 100: ; 4/7e2 ~0.00571428571428571429 ; 4/7 ~0.57142857142857142857 ;Moves the dot two placed to the left.

To move a decimal point 4 places: ; 2.9870e4 29870 ;

Letter e is the only letter used as a sign by Calc. E and any other letter can be used as in algebra to indicate a variable. A letter is used to take the place of an unknown number. An unknown number or the letter standing for it is called a pro-numeral. Known numbers are numerals.

Algebra is arithmetic with letters in place of unknown numbers.

To solve an equation in algebra: Write the equation within quotes then do the sums. ; "If a*7=21 then a=21/7" ; 21/7 3 ; 3*7 21 ;

To ask and answer a true-or-false question: Calc outputs 0 to mean true or 1 to mean false. ; 3>8 0 ; 3>2 1 ; 3 is not less than 2.

To find the square root of a number: Here the number is 16. What number multiplied by itself equals 16? 4*4=16 so ; 16/4 4 ; The square root of 16 is 4. or say the number is 81. ; 9^2 81 ; ^2 means squared. There 9 is multiplied by itself.

What is the square root of 5819 ? Call that number 58. As 7*7=49 and 8*8=64, the square root will be about 7.5. 7.5*7.5 56.25 ; 7.56*7.56 57.1536 ; 7.63*7.63 58.2169

So therefore 76.3 is the square root of 5819. More exactly 76.282370178. What is the cubic root of a number, say 74. What number multiplied by itself twice gives 74? ; 9*9*9 729 ; 9.1*9.1*9.1 753.571 9.05*9.05*9.05 741.217625 So the cubic root of 74 is about 9.

Calc uses ^/ as its sign for square root. Calc does not recognise the square root sign or a sqr or sqrt command. Gcalccmd does recognise sqrt.

user:~$ gcalccmd > sqrt 12 3.464101615 > 3.464101615^2 11.999999999

To check which calculator is being used, look at the first character of the command line: Calc ; Gcalccmd > Wcalc -> Terminal $ Usually it is best to choose just one calculator. In this file, the main calculators used are Calc and Wcalc. >

To calculate a square root with Calc, type ^/2 instead of sqrt: ; 448^/2 21.16601048851672472401 ; 21.16601048851672472401^2 ~447.99999999999999999988 ; 562^/2 23.70653918225939616874 ; 609^/10 1.89872351612187101312 ;

In maths, curved brackets are called parentheses and square brackets are called brackets. As Calc does not use square brackets, round brackets are called just brackets too in the examples below.

In an equation, do any sum in () brackets first, next do any multiplication and division, then do the rest of the equation.

A sign belongs to the next term following it. So the expression 4a-b-3a+5 can only be 4a -b -3a +5 . So 4(a-b)-3(a+5) is a different equation and needs brackets. "4a-b-3a+5" ; 4*a-b-3*a+5 "a" is undefined ; 'Let a=2 and b=5' "Let a=2 and b=5" ; a=2, b=5 ; a+b 7 ; 4*a-b-3*a+5 2 ; 4(a-b)-3(a+5) Missing operator ; 4*(a-b)-3*(a+5) -33 ; Calc needs a * times sign.

In an equation that needs both curved and squared brackets, do the sum in the curved parentheses first and the sum in the square brackets after that. Round brackets go within square brackets, parentheses within brackets.

To use brackets in algebra: 5a+6 That means multiply x by 5 then add 6 5(a+6) That means multiply both x and 6 by 5 then add them together. The parentheses mean 5x + 30. Let a=4 ; a=4 ; 5a+6 Badly formatted number ; 5*a+6 26 ; 5*(a+6) 50 ; Gcalccmd does not recognise the command a=3, pronumber=n, or whatever.

To close Gcalccmd, type quit, enter.

To find the lowest common denominator for two fractions: Multiply the denominators 2/5 and 1/2 = 10 3/4 and 2/3 = 12 > 5*2 10 >

To remove all fractions from an equation, multiply by the lowest common denominator, LCD: eg x/2-x/3=7 ; 2*3 6 6^3 * x/2 - 6^2 * x/3 = 7 * 6 The LCD is 2*3=6 Multiply all terms by 6. 6x/2 - 6x/3 = 42 Simplify the fractions. 3x - 2x = 42 1x = 42 So x is 42.

eg (y-7)/5 - y/3 = 2 LCD=3*5=15 2*15=30 ; '15*(y-7)/5 = 3*(y-7)/1' ; '15*y/3= 5y/1' ; '3*(y-7) - 5y' = 30 ; "3y-21 - 5y" = 30 3y-5y=-2y -2y-21=30 -27=51 y= -51/2 Y equals -25.5

To check whether an answer to an equation is correct, let the answer be the unknown pronumeral.

eg (y-7)/5 - y/3 = 2 "Say y = -25.5" ; y=-25.5 ; (y-7)/5 - (y/3) 2 ;

In this next calculation, brackets must be used. ; 92*38^/2 567.126088273145833423 That's wrong. ; (92*38)^/2 59.12698199637793114476 ;Treat *^/2 like a separate equation. ; 92*38 3496 ; 3496^/2 59.12698199637793114476 ;

To multiply or divide a number by another number many times, use memory: ; m=2 ; 6*m 12 ; 6*m^10 6144 ; 6 is multiplied by 2 10 times. or ; 1909/m^10 1.8642578125 ; 1.8642578125*m^10 1909 ;

To calculate a percentage profit: ; "Sale $98, cost $72" ; (98-72)/72*100 ~36.11111111111111111111 ; The profit is 36% of the cost.

To calculate a price and discount saved: "Price is $428 less 15% discount." ; 428-(15/100*428) 363.8 ; 15/100*428 64.2 ; "Saved $64"

To express a fraction as a percentage: ; 4/14*100 ~28.57142857142857142857 That's 29%. 4 is 29% of 14.

To check a percentage sum: ; 28/100*14 3.92 ; 29/100*14 4.06 ;The numerator of the fraction is 4. The denominator is 14.

To express a ratio as a percentage: Here the ratio is 3:8 ; 3/(3+8)*100 ~27.27272727272727272727 ; 8/(3+8)*100 ~72.72727272727272727273 That is 27%:73% ;

To calculate the simple interest to be earned on a term deposit in a bank: ; 'I=PxRxT/100' ; 'Interest earned = Principal invested x Rate of interest x Term of deposit / 100.' Here I=?, P=$5,000, R=7%pa and the term is 3 months. ; 'I=PxRxT/100' ; 'Interest rate = Principal invested x Rate of interest x Term of deposit / 100.' "Interest rate = Principal invested x Rate of interest x Term of deposit / 100." ; 5000*7*3/12/100 87.5 ; '$88 interest will be earned.' I=$88

To calculate how much interest was paid on a bank loan: I=P*R*T/100 P=amount borrowed R=interest rate T=term of loan, time taken to pay back loan. Here P=$5,300. R= 1 1/2 % a month T = 2 1/2 years. ; 5300*1.5/100*12*2.5 2385 ; '$2,385 was paid in interest for $1,500.' "$2,385 was paid in interest for the loan of $1,500." ;

To abort a calculation, press ctrl-c

To quit Calc and go to the terminal command line, type quit. ; quit username@username-number:~$

When two negative numbers are multiplied or divided, the result is positive. ; -2*-4 8 ;

To find the area of a rectangle or square, multiply width by height: Here a field is 300m long by 160m wide. ; 300*160 48000

To calculate the area of a trapezium: "Formula: A=1/2h*(a+b) where a and b are the lengths of the parallel sides." ; "Height h is the shortest distance between the parallel lines.' ;

To calculate the circumference of a circle, use the formula pie times diameter: Pie always equals 3.1416 Here the radius of the circle is 5cm. ; 3.1416*5*2 31.416

To calculate the area of a circle use the formula pie times radius squared: Here the diameter is 8cm. ; (8/2)*(8/2)*3.1416 50.2656 ;That's 50.3 square centimetres.

To calculate the area of any triangle: Area=half the base times the height, b*h/2 This triangle has a base of 16cm. Draw a line from the apex to the base that is at right angles to the base. The height is 9cm. ; 16*9/2 72 ; "The area of this triangle is 72cm squared."

To calculate the area of any surface having four straight sides: Draw a diagonal to make two triangles. Measure the base and height. Calculate the area of one triangle then double it using the base times height formula, b*h

To calculate the area of a surface with more than four straight sides: Draw more diagonals then use the same formula for a triangle.

To find the volume of a cylinder or a rectangular or square prism, calculate the area of its base then multiply by its height: Volume=base area times height.

All measurements used in a calculation must be in the same units. Don't multiply centimetres by metres for example.

To convert metres to cm, add two zeros, or multiply by 100, or move a decimal place two to the right: 45.69m = 4,569cm Calc does not read commas so ; 45.69*100 4569 ;

To convert cm to m: divide by 100 ; 4569/100 45.69 ;

To calculate the volume of a cylinder: Here a tin can has a diameter of 7.5cm and a height of 10cm. The formula is volume=pie*radius*radius*height V=pie*r^2 First define pie for Calc. ; pie=3.1416 The equation is ;pie*7.5/2^2 ; (7.5/2)^2*pie*10 441.7875 ; "The volume of the can is 442 cubic centimetres"

Calc clears pie and any other definitions from its memory when it quits, so that they do not conflict with future calculations.

To find the height of a cone: Measure the length of its side and its diameter. L^2=h^2+r^2 Here the cone has a side of 8cm and a radius of 4cm. "8^2=h^2+r^2" ; 'So h^2=8^2-4^2' ; 8^2-4^2 48 ; 'So the height is the square root of 48.'

To find the volume of a cone: V=1/3*pie r squared *h V=pieRsqr*h/3 Here the cone is the same one as above. Tell Calc to remember the value of pie. ; pie=3.1416 ; 1/3*3.1416*4^2*(48^/2) ~116.08343076391221131405 ;The volume of the cone is 116 cubic cm. ; 1/3*pie*4^2*(48^/2) ~116.08343076391221131405 That is 48 to the power of 2 squared. ^ means to the power of ^/2 means the square root of / means divided by

To find the volume of a sphere: V=4/3*pieR^3

All three angles within any triangle always add up to 180 degrees. To calculate the size of an an angle in a triangle: "One angle in a triangle is 34 degrees and another is 59." ; 'What is the third angle?' ; '34+59+x=180' "34+59+x=180" ; 180-34-59 87 ; 'Angle x is 87 degrees.'

A submarine sees on its sonar a ship with a bearing of 27 degrees. What is the general direction of that ship? North is 0 degrees and east is 90 degrees. So the ship is north-north-east, NNE. Another ship has a bearing of 193. So it is SSW of the submarine. It is 12 miles away. How far east of the submarine is the first ship? distance east / distance NNE = cos * degrees d/12=cos27 d=12cos27 Kcalc tells the value of cos. Type 27 and press cos. 0.89 cos 26 = 0.89 The distance east is 12*0.98. ; 12*0.89 10.68 ; The ship is 10.68 nautical miles east.

To change a fraction into a decimal, multiply it by the power of 1: 3/4^1 0.75 ; 4/5^1 0.8 or Calc will convert the fraction to a decimal automatically. ; 5/8 0.625 ; The sign ^ means to the power of. 4^10 1048576 ; 4*4*4*4*4*4*4*4*4*4 1048576 ;

Copy and paste decimals into the command line.

To do algebra on this calculator: ; x+6=15 "x" is undefined ; 15-6 9 ; 15/x=3 Illegal assignment ; 15/3 5 ; Ignore the the comments. ; 3a+2a+a=24 Badly formatted number ; 6a=24 Badly formatted number ; 24/6 4 ; a=4 ; 2*a 8

To add a comment to the output of Calc, start the line with ## or type the words between quotes: ; ## This is a comment. ; ; "Calc echoes words." "Calc echoes words." ;

The words can be a title, a comment, an explanation or whatever.

To define a variable for calc to remember: eg x=7 ; x=7 ; 2*x 14 ;

To clear defined variable values from memory, type quit then enter then calc.

To tell calc the value of letters: ; a=4,b=7 ; a*b 28 ;p=3.1416, r=6 ; p*r*r 113.0976

To add or subtract number in a list: ; sum:3+2+1+4 10 ; sum:3+4+1-8 0 or ; 3+4+1-8 0 ;

Calc reads any single word followed by a colon as a label. total=73 ; total-3 70

Calc calls a variable var. ; var=10 ; 7*var 70 But var can be any letter. eg z=10 ; z=10 ; z*2 20 ;

To tell Calc to remember a number: Here the number is pie and the radius is 6. ; pi=3.1416 ; pi*6*6 113.0976

To multiply fractions: Multiply the numerators, top numbers, then multiply the denominators.

eg 3/5*7/8 ; 3*7 21 ; 5*8 40 ; That's = 21/40

eg 3 1/3 * 1 4/5 ; (3*3)+1 10 ; (1*5)+4 9 ; = 10/3 * 9/5 ; 10/3*9/5 6 ;

eg 2/3*3/4*4/5= ; 2/3*3/4*4/5 0.4 ;4/10 is 2/5

To divide fractions: Multiply opposite numerators with opposite denominators. eg 2/3 / 3/5 Invert one fraction then multiply the two fractions. ; 2/3*5/3 ~1.11111111111111111111 ;That is 1 1/9 ; 2*5 10 ; 3*3 9 ;10/9

To add fractions: Multiply the denominators to make them the same as each other. eg 4/5+2/3= ; 5*3 15 ;Then divide to equalise the numerators. ; 3*4 12 ; 5*2 10 ; That gives 12/15+10/15 Then add the numerators. 12+10 22 Gives 22/15 ; 22-15 7 ; 1 7/15

To subtract fractions: Subtract whole numbers first or - eg 5 4/5 - 2 1/2 ; (5*5)+4 29 ; (2*2)+1 5 ; That is 29/5 - 5/2 ; 29*2 58 ; 5*5 25 58/10 - 25/10 ; (58-25)/10 3.3 ; That's 3 3/30

Calc and gcalccmd work much the same.

To find the average or mean of several numbers: user:~$ gcalccmd > (100+200+400+700)/4 350 >> (1+4+3+7+0)/5= 3 The mean is 3.

Gcalc adds the numbers from left to right then divides by the total number of numbers. But without the brackets, the calculator adds 0/5 as a fraction and does not divide. > 1+4+3+7+0/5= 15 > 0/5=0

Those variables range from zero to 7. The highest number or mode is 7 and the mean is 3.

If brackets are used, the answer is different: ; (1+4+3+7+0)/5 3 ; 1+4+3+7+0/5 15 ;

To add or subtract and multiply or divide in an equation, type brackets: Use brackets around additions and subtractions. eg 2*(3+1) can be written in algebra as 2*3+2*1 but that is different from 2*3+1. user:~$ gcalccmd > 2*(3+1)= 8 > 2*3+2*1 8 > 2*3+1 7 > (1/2+1/4)*2 1.5 > > 1/2 0.5 > 1/4 0.25 > 0.5+0.25 0.75 1-1/3 > 0.75*2 1.5 >

Without the brackets, gcalc multiplies or divides first then adds: user:~$ gcalccmd > (2+1)*(3+6) 27 > 2+1*3+6 11 > That is 1 times 3 then plus 2 + 6. eg > 2+(2*3)+4 12 >

Numbers in brackets are calculated separately. > 3+21/7+6 12 >

Numbers without brackets are calculated from left to right, 3+21/7=6.

To avoid ambiguity in equations, use brackets: > 24/4*2 12 > 24/(4*2) 3

Brackets are needed with some multiplication and division of powers: ; eg 1000/2^3 125 ; 1000/(2^3) 125 ; 5*10^2 500 ; (5*10)^2 2500 ; 8/4^4 0.03125 ; (8/4)^4 16 ;

Calc cannot read brackets within brackets but gcalcmd can. > ; [(2+3)*10]/3 Left bracket with no preceding value see calcsudo.txt > [(2+3)*10]/3 16.666666667 > 50/3 16.666666667

To remove brackets in algebra: ;In algebra '5(2a+3)' ; '5(2a+3)=5x2a+5x3' ; 'That's 10a+15 In Calc, give the variable a numeric value. Say a=2. ; a=2 ; a 2 ; 5*(2*a+3) 35 ; Calc needs the * time sign.

To add or subtract negative numbers: Minus a minus number is a plus, --=+. > -2--7= 5 > -2-7= −9 > -4+-5 −9 > > -4+5= 1 > 3-+9= −6 > +8-+5 3 > 3-9 −6 > 8-5 3 >

To multiply two negative numbers: user:~$ gcalccmd > 2*4= 8 > -2*-4= 8 > -2*4= −8 >

Two negatives multiplied give a positive answer.

To divide two negative numbers: user:~$ gcalccmd > -4/-2 2 > 4-2 2 > -4/2 −2 >

A negative number divided by another negative gives a positive answer.

No number can be divided by zero. > 8/0 Error Division by zero is undefined >

To mark up the wholesale price of an item to give it a retail price: Here the cost is $110 and the markup is 30%. > 110+(30/100*110)= 143 > 30/100*110 33 > 33+110= 143 > The selling price is $143.

An advantage of the terminal calc over pocket calculators or graphic programs is that previous sums stay on screen as you calculate.

To calculate double minus numbers in algebra: Two minuses together make a plus. user:~$ gcalccmd > 7--2 9 >

Think of a barometer scale with numbers above and below zero degrees. Two degrees less below zero is two degrees warmer. > 7-(-2) 9 >

Or use brackets to show the logic of the equation. > 7-(-2+3) 6 > Minus 2 plus 3 is 1. 7-1=6. > 7+2-3= 6 >

If you remove the brackets and change the two minuses to a plus, you must change any other pluses to minuses and any other minuses to pluses. > 7-(-4+3-2+5)= 5 > 7+4-3+2-5= 5 >So just use brackets.

To repeat or edit the previous command in calc, press the up arrow.

To store a number or sums in memory, use the m key: ; m=5 ; 20*m 100 ; m=33/100 ; m*158 52.14 ;The markup is 1/3 of the $158 retail price. ;

To clear memory, type m= then press enter. Do not type m=0 ; m=0 ; m 0 ; 5*m 0 ; m= ; 5*m ; 5+m 5 ;

;To erase the value of a pronumeral, type the letter and = then press enter or return: ; a=9 ; a 9 ; a=7 ; a 7 ; a= ; a

;To change the value of a pronumeral: There is no need to erase any old value as it will be replaced. ; b=6 ; b=3 ; b 3 ;

To solve algebraic problems: Express the problem within quotes then calculate to find the unknown variable. ; "r+9=19" "r+9=19" ; 19-9 10 ; "So r=10" ; "t-6=6" "t-6=6" ; 6+6 12 ; "So t=12" "8a=24" ; 24/8 3 ; a=3 "t/9=5" ; 5*9 45 ; t=45 ;

"A number divided by 8 gives 720. What is the number." ; 720/8 90 ;

"A man aged 60 is 5 times as old as his son. How old is his son?" ; "5s=60" ; 60/5 12

Calc uses an asterisk * not an x to mean times or multiply. ; 3x6 Badly formatted number ; 3*6 18 ;

"Find the answer to the expression 2a+b-c when a=3,b=2 and c=1"

The variables can be put to memory. ; a=3, b=2, c=1 ; (2*a)+b-c 7

; Calc does not read 2a. So type 2*a. ; or 2*a+b-c 7 ;but not ; 2*(a+b-c) 8 ;; 2*(a+b)-c 9

; 7 is the right answer as the expression had no brackets. That means 2a is a separate calculation.

To avoid any ambiguity in an expression or equation, use brackets: Brackets group some numerals and pronumerals together and separate them from others. ; "3(x-5)=24" ; "(x-5)=24/3" ; 24/3 8 ; "x-5=8" ; 8+5 13 ; "x=13" ; '(4x+3)squared' ; x=5 ; x 5 ; (4*x)+3 23 ; 23^2 529 ; 23*23 529 ; 4*(x+3) 32

;In algebra, a number multiplied by a pronumeral, like 6x, cannot be changed to 6(x + something) as that would change the expression. Putting an * between the 6 and x, 6*x, does not change the expression. ; '3*(x+5)+6x-5' 9x+10 ; x=5 ; x 5 ; 3*(x+5)+(6*x)-5 55 ; "3*(x+5)+[6*(x-5)]" ; x+5 10 ; x-5 0 ; 6*0 0 ; 3*10+0 30 ;

When x=5, the answer is 32 or 5. But with algebra, the answer is 32 because algebra says 6x can only mean 6*x, not 6 times something else. A bracket between the 6 and x would change the whole equation.

Calc reads from left to right. ; a 7 ; ; 221*a-1 1546 ; (221*a)-1 1546 ;but ; 221*(a-1) 1326 ; (a-1)*221 1326 ;

Moving brackets can change the expression. ; a-1*221 -214 ; a-(1*221) -214 ; ; "5(2a+1)=4(3a-1)" Let a = 7 ; a=7 ; (2*a)+1 15 ; 5*15 75 ; (3*a)-1 20 ; 4*20 80 ; 75<80 Try again "5(2a+1)=4(3a-1)" ; 2*(a+1) 16 ; 3*(a-1) 18 ; 5*16 80 ; 4*18 72 ; "80>72" "80>72" ; a 7 ; 4*-1 -4 ; 3*a 21 ; 3*-1 -3 ; 21-3 18 ; So 4*3a-4 = 3*(a-1) When ; a=3 ; b=2 ; c=1 then twice C is 2 ; 2*c 2 and ; 2*b 4 ; 3*(a+b) 15 ; 3*a+3*b That is ambiguous. So there is no answer. ; (3*a)+(3*b) 15 ; ; "4(a+2b)" "First do the sum in the brackets." ; a+(2*b) 7 ; 4*7 28 but ; (a+2)*b 10 ; 4*10 40 ; 4*a+8*b 28 ; So the right answer is 28, not 40, because algebra sees the 2b as one expression separate from what follows it.

To calculate speed: Speed = distance x time s=d*t A car will run at an average of about 70 kilometres an hour between two towns 80 kilometres apart. How long will that take? Formula: t=d/s ; 80/70 ~1.14285714285714285714 ; 'Time= 1.14 hours'

Average speed = distance travelled / time taken

Acceleration is the rate of change of velocity.

In calculus maths, a derivative is a rate of change. d = derivative v = velocity a = acceleration t = time x = displacement

Displacement is the distance measured in one direction from one position to another. Here d does not mean distance or displacement.

An object at rest has a velocity of zero, a time of zero and a displacement of zero. v=dx/dt a=dv/dt

As an object is moving from left to right on a straight line, it is moving forward. As it moves to the left, it is going backward.

At its initial position, t = 0.

It originates at position x=0.

When v=0 the object is stationary.

When the object is moving at a uniform speed, a=0. displacement can be measured in metres, m, or some other linear unit, x=m . time can be measured in minutes, velocity in minutes per second, m/s .

As t increases, the object is accelerating.

As t decreases, the object is decelerating.

To solve problems using trigonometry: Functions of trigonometry are sine, cosine and tangent, sin, cos, tan.

A right-angle triangle has two acute angles. The longest side is called the hypotenuse. An acute angle is between the hypotenuse and an adjacent side. The side opposite that acute angle is the opposite.

The tangent of an acute angle, tan, is the ratio of the length of the opposite side to that of the adjacent side in a right-angle triangle. It is the ratio of the sine of an angle to the cos of that angle, the ratio of sine to cosine, sin:cos. tan=sin:cos tan 0 = sin 0 / cos 0

The tangent ratio for an angle is the opposite side divided by the adjacent side. tan=opposite/adjacent. tan 0 = opposite/adjacent

The tangent ratio of an angle is the same for any size triangle.

The ratios can be found using a different formula for obtuse angles. In any triangle, the ratio of any side to the sin of its opposite angle is constant. opposite side / sin angle

The sin rule is as follows for a triangle with angles A, B and C. side a / sin A = side b / sin B = side c / sin C

Calc calculator does not recognise the terms sin, cos or tan. Kcalc does. Use Kcalc or a sin table to find the sin of an angle.

When the three angles of a triangle are: A = 66 degrees B = 35 " C = 180-66-35 = 79 ; 180-66-35 79 ; Side b is 15.6cm long. Sides a and c are not known. Find the length of side a. side a = 15.6 x sin 66 / sin 35 Using Kcalc, type the angle then press the sin button. sin A = 0.91 sin B = 0.57 15.6*0.91/0.57 Using Calc again, ; 15.6*0.91/0.57 ~24.90526315789473684211 ; Side a is 24.9 cm.

In trigonometric functions, angles are sometimes measured in radians instead of degrees.

A radian is the angle between the two radii radiuses of a segment of a circle with an arc the same length as the radius.

One radian is about 57.2958 degrees.

Pie equals 3.1416 -> #Let p for pie equal 3.1416 -> p=3.1416 display_val pdisplay_val = 3.1416 -> p ~= 3.1416 -> There are 360 degrees in a circle -> 360/57.2958 = 6.28318 -> So about 6 1/3 radians make a circle.

To change radians to degrees, multiply by 180 degrees and divide by pie: -> 6.3*180/p = 360.963 -> So 6.3 radians equals about 361 degrees.

To change or convert degrees to radians, multiply by pie and divide by 180 degrees: -> 60*p/180 = 1.0472 ->So 60 degrees is about 1 radian.

eg -> 180*p/180 = 3.1416 ->180degrees is about 3.14 radians. So three and a bit radians fit into half a circle ... and that answer is pie.

To start Kcalc, run this command in Terminal: kcalc Minimise terminal so see Kcalc window.

Gnome Calculator and LibreOffice Calc are graphic, gui, and they are is installed with Ubuntu. Libre calc is for spreadsheets.

KCalc gui is a scientific calculator which is already installed with Ubuntu. user:~$ kcalc Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Icon theme "breeze" not found. Minimise Terminal to see GUI window of KCal. Select settings tab, scientific. It has keys for %, Pi, sin, cos, tan ... It also has a statistics mode. Select settings history to show previous calculations in side window. Press AC to clear calculations and history. user:~$ kcalc Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. KCalc is safe.

BC is a very basic calculator which comes with Linux. Type a sum and press enter. 1+2 3 5/2 2 5*3 15 4^2 16

BC is mainly for programmers. Its % sign is used in programming, not maths.

A handy calculator for basic use is Gcalccmd. Search this file for more calculators like kcalc and wcalc.

To run a calculator from the terminal: gcalccmd user:~$ gcalccmd > 2+4= 6 > or $ calc

To close the calculator and go back to the terminal command line, type quit. To close the calculator and exit Terminal, type > exit. To restart the calculator: In terminal, press the up arrow and select gcalccmd

To calculate a percentage of a number: user:~$ gcalccmd > 5/100*300= 15 > To show a fraction or a decimal as a percentage, multiply it by 100: > 30/100*100 30 > 30 over 100 is 30% > 50/1000*100 5 > That's 5%.

To change a decimal to a percentage: > 1.2354*100 123.54 > That's 124%, moving the decimal place 2 to the right.

To calculate a percentage then check the result: This time using Wcalc. Let p = 100 -> p=100 display_val = 100 -> p = 100 -> 25/95*p = 26.3158 25 is 26% of 95. Check -> 100/26.3158 = 3.8 -> 26.3158*3.8 = 100 -> Right.

eg -> 2/676*100 = 0.295858 -> That's 0% on a pie chart.

To multiply: > 467890*98761= 46209284290 > > 3*(4+7) 33 > No need to type an = sign.

To find the average or mean of several numbers: user:~$ gcalccmd > (100+200+400+700)/4 350 >> (1+4+3+7+0)/5= 3 The mean is 3. Gcalc adds the numbers from left to right then divides by the total number of numbers. But without the brackets, the calculator adds 0/5 as a fraction and does not divide. > 1+4+3+7+0/5= 15 > 0/5=0 Those variables range from zero to 7. The highest number or mode is 7 and the mean is 3.

The calculator does not read algebra. > (3a*2b)-(2a*b)= Error 3 > (2m+3m)/5m Error 1 >

So use arithmetic instead of algebra. x+6=15 so x=15-6=9 15/x=3 so x=15/3=5 3x+2=14 so 14-2=3x, 3x=12, 12/3=4 so x=4 11-x=5 so x=11-5=6

To change algebra into arithmetic, add * time signs: user:~$ gcalccmd

eg 4 and three fifths becomes 4*3/5. > 4*3/5*2*3/4= 3.6 > 3/5= 0.6 > 3/4 0.75 > 4*0.6*2*0.75= 3.6 >

To add or subtract and multiply or divide in an equation, type brackets: Use brackets around additions and subtractions.

eg 2*(3+1) can be written in algebra as 2*3+2*1 but that is different from 2*3+1. user:~$ gcalccmd > 2*(3+1)= 8 > 2*3+2*1 8 > 2*3+1 7 > (1/2+1/4)*2 1.5 > > 1/2 0.5 > 1/4 0.25 > 0.5+0.25 0.75 1-1/3 > 0.75*2 1.5 >

Without the brackets, gcalc multiplies or divides first then adds: user:~$ gcalccmd > (2+1)*(3+6) 27 > 2+1*3+6 11 > That is 1 times 3 then plus 2 + 6. eg > 2+(2*3)+4 12 >

Numbers in brackets are calculated separately. > 3+21/7+6 12 >

Numbers without brackets are calculated from left to right, 3+21/7=6. To avoid ambiguity in equations, use brackets: > 24/4*2 12 > 24/(4*2) 3 >

The calculator can read brackets within brackets, curved and square brackets.

To use brackets within brackets: > [(2+3)*10]/3 16.666666667 > 50/3 16.666666667 >

To use brackets in algebra: eg (-a)^3 = -a x -a x -a -a@ = a a x -a = -a2

A minus times a positive gives a minus.

A minus times a minus gives a positive. ; a=2 ; (-a)^3 -8 ; -a^3 -8 ;That is -2 * -2 * -2 = 2*-4 =-8 ; -2^3 -8

;Calc did not need the brackets because although the number was negative, the expression was all multiplication with no adding or subtracting. (ab) x (ac) = a^2 x cd Let b=3 and c=5 ; b=3, c=5 ; (a*b)*(a*c) 60 or ; a*b*a*c 60 ; (a^2+a^2)/a^2 ; (a^2+a^2)/a^2 2 That is right. ; a^2+a^2/a^2 5 ;That is wrong because an equation which mixes + or - with x or / needs brackets. 7/(5-3)= ; 7/(5-3) 3.5 ; but 7/5-3 -1.6

; Without the brackets, it's a different sum with a different answer.

To convert a fraction into a decimal: Divide the top number by the bottom number. > 3/4 0.75 >

To write a decimal number as a fraction: Count the decimal places. eg 0.3 = 3/10 > 3/10= 0.3 >

eg 0.9347 - 0.9 is a tenth, one decimal place, 0.03 is 3 hundredths, 0.004 is four thousandths and 0.00007 is 7 ten thousandths; that is 9/10, 3/100, 4/1000 and 7/10000. That is 9347 ten thousandths. So the fraction is 9347/10000, about 9 tenths. > 9347/10000 0.9347 is zero plus 9/10 > 9/10= 0.9

>eg The decimal 14.327 is equal to 14+(327/1000). > 14+(327/1000)= 14.327 > 14 numerals, whole numbers, plus about 3/10.

To calculate the square root of a number, sqrt: The number here is 16. > sqrt 16 4 > because 4^2=16

The square root is the number which when multiplied by itself makes 16. So the square root of 16 is 4. > sqrt 1764 42 > 42*42= 1764 >

Calc does not read the abbreviation sqrt . It reads ^/2 ; 16^/2 4 ;

What is the square root of 500? ; 500^/2 22.36067977499789696409

A cube is the result of multiply a number by itself three time, 3 to the power of 3. To find the cube of a number: eg 3*3*3= > 3*3*3 27 >

Gcalc uses the sign ^ to mean to the power of. So 3^3 is 27.

To add or subtract negative numbers: Minus a minus number is a plus, --=+. > -2--7= 5 > -2-7= −9 > -4+-5 −9 > > -4+5= 1 > 3-+9= −6 > +8-+5 3 > 3-9 −6 > 8-5 3 >

To multiply two negative numbers: user:~$ gcalccmd > 2*4= 8 > -2*-4= 8 > -2*4= −8 >

Two negatives multiplied give a positive answer.

To divide two negative numbers: user:~$ gcalccmd > -4/-2 2 > 4-2 2 > -4/2 −2 >

A negative number divided by another negative gives a positive answer.

No number can be divided by zero. > 8/0 Error Division by zero is undefined >

To mark up the wholesale price of an item to give it a retail price: Here the cost is $110 and the markup is 30%. > 110+(30/100*110)= 143 > 30/100*110 33 > 33+110= 143 > The selling price is $143.

To calculate many fractions as percentages: Store p=100 in memory. -> p=100 display_val pdisplay_val = 100 -> p = 100 Write p times the first fraction in brackets. -> p(4/20) = 20 So 4 is 20 % of 20. Press the up arrow to repeat the equation and enter the next fraction. -> p(5/50) = 10 ->

Gcalccmd understands most arithmetic signs. But it does not read dollar $, square root or division signs other than / . Instead it reads sqrt and / . It can read a % percentage sign like this: > 4/20% 20 instead of > 4/20*100 20 user:~$ gcalccmd > 20/100% 20 > 20/50% 40 > 20/5000% 0.4 > %

To do algebra using Gcalccmd calculator: Write an equation, > x+8=12 Error 3 X is not understood. So use arithmetic. > 12-8= 4 > Therefore x = 4. > x-7=21 Error 3 Ignore the error note. > 21+7= 28 >So x =28. > 3x=18 Error 3 > 18/3= 6 > So x=3. > x/3=12 > 3*12= 36 > x=36 > 36/3= 12 > Type an equation. > 2x+4=12 Error 3 Ignore error. > x=(12-4)/2 4 > X=4 is the answer or root of the equation. > 17y-4=30 Error 3 > (4+30)/17 2 > Y=2 > 5a/3=10 Error 3 > (3*10)/5= 6 > a=6 6 >

To clear the screen in gcalc: > Press the enter key then run the gcalccmd command again. or > quit user:~$ clear user:~$ gcalccmd >

To clear a command line which starts with two semi colons, ;;, in Calc: ;; ^c Abort ; To solve complex equations: Keep using simple arithmetic.

eg > 3b/2+6=15 Error 3 > 15-6= 9 > x=9/3*2 6 > So b is 6. or 3b/(2+6)=15 > 3b/8=15 > b=8*15/3 Error 1 > 8*15/3= 40 > 8*15 120 > 120/8= 15 > b=40 Error 1 > 40 is right. Ignore error.

An advantage of the terminal calc over gui is that previous sums show on screen as you calculate.

To calculate double minus numbers in algebra: Two minuses together make a plus. user:~$ gcalccmd > 7--2= 9 >

Think of a barometer scale with numbers above and below zero degrees. Two degrees less below zero is two degrees warmer. > 7-(-2)= 9 >

Or use brackets to show the logic of the equation. > 7-(-2+3)= 6 > Minus 2 plus 3 is 1. 7-1=6. > 7+2-3= 6

>If you remove the brackets and change the two minuses to a plus, you must change any other pluses to minuses and any other minuses to pluses. > 7-(-4+3-2+5)= 5 > 7+4-3+2-5= 5 >So just use brackets. > -2*-2 4 > That is 2 squared or 2 to the power of 2. Gcalc reads the shift-6 sign ^ to mean to the power of. > 2^2 4 > > -3*4*(-3*5)= 180 >Two -3 * -3 = +3^2 = 9. 9*4*5 > 9*4*5= 180 > > a^4*b^2*a^2= Error 1 >

Gcalc cannot read algebraic letters representing unknown numbers.

Run the command kcalc for a gui calculator.

eg 4% of 800 is 4/100*800 = 32 C is for clearing the field for a new sum.

To find the command to run a calculator: $ ls /bin Scroll the list of binary files to find a filename with calc in it. Use that filename as the command. user:~$ ls /bin '[' mkpasswd aa-enabled mksquashfs gcalccmd etc calc kcalc

Kcalc has a graphic user interface, gui. user:~$ calc Command 'calc' not found, but can be installed with: sudo apt install calc user:~$ sudo apt-get install calc [sudo] password for user: Reading package lists... Done Building dependency tree... Done Re etc user:~$ calc C-style arbitrary precision calculator (version 2.12.7.2) Calc is open software. For license details type: help copyright [Type "exit" to exit, or "help" for help.] Type a sum here after the semicolon. ; 2+5= Illegal assignment

Libre Office spreadsheet calculator takes the following commands: =SUM(2;3;4) =SUM(A2;A4;A7) =SUM(E2:E6) There letters A and E are cell names. The third example adds all cells from 2 to 6 in column E. Type a sum formula into the top field then press enter.

There are four types of real numbers: integers, rationals, surds, transcendentals. An integer is a whole number. A rational is a fraction or ratio. A surd is an endless decimal with a root in the answer to an equation. A transcendental is the sum of a series of numbers. Surds and transcendentals are irrational endless decimals. All four types of numbers add, subtract, multiply and divide the same way.

eg ; 36^/2 6 ; (36^/2)^2 36

eg ; "^/ab=^/a*^/b" ; "Let a=6 and b=3" "Let a=6 and b=3" ; a=6 ; b=3 ; a 6 ; b 3 ; a^/2*b^/2 ~4.24264068711928514642 ; (a*b)^/2 4.2426406871192851464 Brackets are needed there.

eg ^/a/b=^/a/^/b ; (a/b)^/2 1.4142135623730950488 ; a^/2/b^/2 ~1.41421356237309504880 ;

A surd is an endless decimal containing a root, like a cubic root, eg ^/3 or 2^/3, and it is said to be an irrational number. It is not a whole number or a whole fraction or decimal.

To calculate with surds:

What is the square root of 5? ; 5^/2 2.23606797749978969641 What is the square root of 5 squared? ; 2.23606797749978969641^2 ~5.00000000000000000000 ;

In algebra: ab^/2 = a^/2 x b^/2 a/b^/2 = a^/2 / b^/2 (a^/2)^2 = a

Those are three rules for calculating with surds.

Using Calc - Let a=3 and b=4. ; a=3 ; b=4 ; a 3 ; b 4 ; (a*b)^/2 = a^/2*b^/2 ; (a*b)^/2 3.46410161513775458705 ; a^/2*b^/2 3.46410161513775458706 ; a/b^/2 ; a/b^/2 1.5 Check that answer. ;(a^/2)/(b^/2) ; (a^/2)/(b^/2) ~0.86602540378443864676 ; But 1.5 does not equal 0.9 ; (a/b)^/2 0.86602540378443864676 ;

So the Calc program needs those brackets.

To multiply two surds using Calc: 3^/2x12^/2 ; 3^/2 1.73205080756887729353 ; 12^/2 3.46410161513775458705 ; 1.73205080756887729353*3.46410161513775458705 ~6.00000000000000000000 ; or use brackets (3^/2)*(12^/2) ~6.00000000000000000000

To divide with surds: What is the square root of 3 divided by the square root of 6? ; 3^/2 / 6^/2 = ; (3^/2)/(6^/2) ~0.70710678118654752440 ;The answer is 0.7 Check that with ; (2^/2)/2 0.7071067811865475244

To simplify an algebraic sentence, calculate as much of it as is possible without knowing the value of the variable, the pronumeral.

egs 3+4+x = 7+x 5 + xy + 8 = 13+xy 5x*2y*6z = 60xyz ; '5x*2y*6z' "5x*2y*6z" ; 5*2*6 60 ; 60xyz

Calc can take long numbers and expressions copied and pasted without them being simplified, if numbers are substituted for any variables.

What is the sqrt of 12 divided by 5 times the sqrt of 3? 12^/2 / 5*(3^/2) = 2/5 ; (12^/2) / 5*(3^/2)

Calc uses only one set of brackets. So break the equation up into smaller expressions. ; 12^/2 3.46410161513775458705 ; 3^/2 1.73205080756887729353 ; 5*1.73205080756887729353 8.66025403784438646765 ; 8.66025403784438646765/3.46410161513775458705 ~2.50000000000000000001 ; 3.46410161513775458705/8.66025403784438646765 ~0.40000000000000000000 ; 4/10 simplified is 2/5 Equation: 3^/2 -1 / 3^/2 = 3- 3^/2 / 3 ; 3^/2 1.73205080756887729353 ; 'Less 1 = 0.73205080756887729353' ; .73205080756887729353/1.73205080756887729353 ~0.42264973081037423549 Check ;; 3-1.73205080756887729353 1.26794919243112270647 ; ; 1.26794919243112270647/3 0.42264973081037423549 ;

Surds usually are simplified before being added or subtracted.

To add and subtract surds: ; (3^/2)+(2^/2)/(2^/2) 2.73205080756887729353

That answer should be 2.225. Calc cannot read brackets within brackets. So check the equation by doing it in parts. ; (3^/2)+(2^/2) 3.14626436994197234233 ; (2^/2) 1.4142135623730950488 ; 3.14626436994197234233/1.4142135623730950488 ~2.22474487139158904910 ; Right. ; '2*5^/2 - 3^/2 / 5^/2 = 1.225' "2*5^/2 - 3^/2 / 5^/2 =" ; (2*5^/2)-3^/2 2.74008514743070209929 ; 2.74008514743070209929/5^/2 ~1.22540333075851662296 ;

To solve a quadratic equation: eg ; '(x-7)(x-5)=0' ; 'So x-7=0 or x-5=0' ; 0+7 7 ; 0+5 5 ; 'So x is 7 or 5.'

eg ; '(x+8)(x-2)=0' ; 'x+8=0 or x-2=0' ; 'x=0-8 or 0+2' ; 'Therefore x is -8 or 2'

eg ; 'x^2-16=0' ; 'x^2=0+16=16' ; 16^/2 4 ;

eg ; 'x^2-x-3=0' ; 'x^2-x=3 ; 'x^2=3+x' ; x^/2 0

Calc cannot calculate with the pronumeral. ; 'The answer is x=2.30 or-1.30'

Factorising helps solve quadratic equations by cancelling out fractions and changing an expression into a multiplication.

To factorise an an algebraic expression: eg x^2-4/x^2+2x = (x+2)(x-2)/x(x+2) As x+2 cancels out in the division, the answer is =x-2/x

eg x^2-2x-63=0 So x^2-2x=63 7*9=63 (x+7)(x-9)=0 So x+7=0 or x-9=0 and x=-7 or 9.

To calculate the average of a list of numbers, the mean: avg ; avg (7+3+2+5)/4 4.25 Calc ignores the avg command and wcalc does not recognise it. So do without it. ; (7+3+2+5)/4 4.25 ;

To show list of built-in calc commands, start calc and run this command at the ; prompt: help builtins

Press enter to scroll.

Some of the builtin commands are: append value to end of list cos ctime delete 2 delete element from list a at position b hypot 2-3 hypotenuse of right triangle within accuracy c insert 2+ insert values c ... into list a at position b ilog 2 integral log of a to integral base b poly 1+ evaluates a polynomial given its coefficients or coefficient-list places 1-2 places after "decimal" point (-1 if infinite) pi 0-1 value of pi accurate to within epsilon remove 1 remove value from end of list round 1-3 round value a to b number of decimal places rsearch 2-4 reverse search matrix or list for value b starting at index c search 2-4 search matrix or list for value b starting at index c list 0+ create list of specified values log 1-2 base 10 logarithm of value a within accuracy b modify 2 modify elements of a list or matrix pi 0-1 value of pi accurate to within epsilon sin 1-2 sine of value a within accuracy b sqrt 1-3 square root of value a within accuracy b sum 0+ sum of list or object sums and/or other terms tan 1-2 tangent of a within accuracy b usertime 0 user mode cpu time in seconds

To draw a graph for co-ordinate geometry:

On graph paper or plain paper, draw a horizontal axis called x crossed by a vertical axis called y.

Where the two axes cross is zero 0. Positive numbers go from zero to the left on the horizontal axis and upward on the vertical.

Draw a straight line sloping across the graph and crossing one or both axes.

Draw a little arrow head on top of that line.

If the arrow points left, the line is in a positive direction, if right in a negative direction.

Plot two points on the sloping line by marking them with dots, one near zero and the other high up.

Call the lower point A and the upper point B.

Write the co-ordinates of those two dots as (x,y) by measuring from the scales of the x and y axes. The co-ordinates will be written as A(x,y) and B(x-y), like A(1,2) B(4,3).

Co-ordinate numbers to the left of zero on the x axis are negative, as are numbers below zero on the y axis. A negative in a co-ordinate is written like A(-2,1), -2 on the x scale and 1 on the y scale.

The rise of a line from A to B is measured from the vertical y axis and the run of the line is measured from the horizontal x axis. A line between co-ordinates a(4,2) and b(-2,1) has a rise of (x-y) 4-2=2 and a run of (x-y) 4--2=6. The gradient of a line is its rise divided by its run. So g=rise/run. eg g=2/6=1/3 ; 2/6 ~0.33333333333333333333 ;

To calculate the gradient of a straight line: The formula is gradient = vertical rise / horizontal run gradient=rise/run m=r/r But r/r = 0 so try g=s/h, gradient = slope divided by horizontal. g=s/h

Plot the gradient line on a graph with a vertical axis y and a horizontal axis x.

Mark the start of the grade with a dot and the end with another dot.

Draw a horizontal base starting from the first dot and runnng past the second dot.

Make a right-angle triangle by drawing the third side from the second dot to the base.

The horizontal h is the length of the base of the triangle.

If g were zero 0, the line would be flat, horizontal. Lines with the same gradient are parallel.

eg A line on a graph rises from co-ordinate x1,y1 to x2,y2 X and y here are co-ordinates, not pronumerals. g=/s/h g=y2-y1/x2-x1 ; 2-1/2-1 0.5 ; g=0.5 Gradient g or m is 1/2.

eg A line on a graph from point A to point B has co-ordinates 3,0 and 6,-4 . How long is the line? ;; 3-0 3 ; 6+-4 2 ; 3+2 5 ; What is the gradient of the line? g=s/h -4-0/6-3 -4-0 -4 ; 6-3 3 ; -4/3 ~-1.33333333333333333333 ; The gradient is -4/3 . ; (-4-0)/(6-3) ~-1.33333333333333333333 ; Brackets are needed there to find the right answer.

Calculus calculates gradients on a curve.

To calculate the gradient of a curve, draw a graph as above but with a curve and a small, right-angle triangle on each gradient point of the curve.

If the gradient of a curve were zero, the curve would be at a turning point, from down to up or from up to down. So slope or rise can be up or down.

A point of inflexion of a curve is where the curve changes from being concave to convex, or convex to concave.

A secant is a straight line going through two points on a curve of a graph.

To find the gradient or slope of a secant: Here the secant goes through points A(1,1) and B(2,4). gradient=A(x-x) divided by B(y-y) g=(x-x)/(y-y) g=(4-1)/(2-1) ; (4-1)/(2-1) 3 ;The gradient of the secant is 3. That is the average rate of change between the two points is 3. The gradient or slope is the rate of change of a line.

In that formula, the letter m is often used instead of g. eg The co-ordinate points B and A on a secant line are B(x5,y7) and A(x3,y6) as measured from the x and y axes. See secant.jpg graph. g=(5-3)/(7-6) ; (5-3)/(7-6) 2 ; "That is wrong because the secant is rising and so the higher numbers should be on top of the fraction." ; (7-6)/(5-3) 0.5 ; "The gradient of the secant is 0.5."

Wcalc is a good scientific calculator which works from the command line. user:~$ wcalc Command 'wcalc' not found, but can be installed with: sudo apt install wcalc user:~$ sudo apt-get install wcalc It installs easily.

To calculate with wcalc: -> 1+2+6 = 9 -> 2*4 = 8 -> 8/4 = 2 -> -> 2^2 = 4 -> sqrt 18 = 4.24264 ->

So it is like Calc but the command line begins with -> instead of ; it uses the = sign and it uses sqrt instead of ^/2. -> pi ~= 3.14159 ->

Wcalc ignores the sum command, just type -> 1+2+3-1 = 5 ->

Wcal can remember or change the value of a variable -> m=4 display_val mdisplay_val = 4 -> m = 4 -> m=3 display_val mdisplay_val = 3 -> m = 3 -> -> sin 67 = 0.920505 -> cos 95 = -0.0871557 -> tan 49 = 1.15037 -> logtwo 30015 = 14.8734 -> log 30015 = 4.47734

-> Those are a base 2 and a base 10 logarithm.

To find the average of a list of numbers by using Wcalc: -> (2+6+9+5+1)/5 = 4.6 ->

Wcalc does not use avg, min or max.

To calculate a percentage: eg -> 10/100*800 = 80 -> or -> 2% 100 = 2 ->

To change a fraction to a percentage: -> 3/4*100 = 75 ->

To save a number into memory: m=number -> m ^ Undefined variable: m -> m=104 display_val mdisplay_val = 104 -> 2m = 208 ->

To save the value of a variable pronumeral into memory: Here the variable is x. Let x be 300 -> x=2 display_val xdisplay_val = 2 -> x = 2 -> 300x ^ Undefined variable: x -> 300*x = 600 -> An error is shown by ^ in Wcalc. The times * sign must be used.

Many letters in Wcal are predefined with values than cannot be changed for pronumerals. -> a = 600 -> b ~= 0.00289777 -> c ~= 2.99792e+08 -> e ~= 2.71828 -> g ~= 9.80665 -> h ~= 0 -> k ~= 0 q=quit -> u ~= 0

Letter a is a variable reserved to mean the previous answer. To use the last answer in a calculation: -> 2*6 = 12 -> a+2 = 14 ->

The following letters are not predefine: d, f, i, l, m, o, p, r, v, w, x, y, z. So with Wcalc use only the letters v, w, x, y, z as pronumerals in algebra.

To give a letter a numerical value as a pronumeral: -> x=4657 display_val xdisplay_val = 4657 Then check -> x/4 = 1164.25 ->

To round a decimal to a whole number: -> round 78.453622 ~= 78

To write a comment in wcalc, start it with a hash mark #: -> # This is a comment. ->

To show help instructions for Wcalc, type help: -> help

To quit Wcalc, press q or type quit.

Unlike Calc, Wcalc recognises three type of brackets: () {} []

To solve an equation using parentheses () and brackets []: x-3/2-x-1/3=x-7/4 x=7 [(x-3)/2]-[(x-1)/3]=(x-7)/4 What is the value of x? x*4=[(x-3)/2]-[(x-1)/3]+7/4 Use the answer 7 to test the brackets. -> x=7 display_val xdisplay_val = 7 -> x = 7 -> [(x-3)/2]-[(x-1)/3]+7/4 = 1.75 -> a*4 = 7 ->

So wcalc understands parentheses within brackets. -> {[(x-3)/2]-[(x-1)/3]+7/4}*4 = 7

-> Wcalc also understands three sets of brackets within brackets. Using more brackets keeps an equation together instead of breaking it up.

Using square brackets alone instead of curved brackets saves pressing the shift key. -> [24-7]/3 = 5.66667 -> a*3 = 17 -> [5.66667*3]+7 = 24 ->

To simplify a fraction, divide numerator and denominator by the highest common denominator: eg 6ab/8a Divide by 2 3ab/4a a/a=0 So 3b/4 is the simplest. -> 6ab/2 ^ Undefined variable: ab -> Wcalc, Calc and other calculators do not understand pronumerals.

Whatever simplification is made to one side of an equation must also be made to the other, to keep both sides equal to each other.

To simplify by removing brackets: eg 3(a+b)=3*a + 3*b=3a+3b eg 3b(ad+4c)=3b*ad+3b*4c=3bad+12bc n(x+y)=nx+ny x(m-f)=xm-xf 2x[7-4y]=14x-8xy

To find common factors within an expression and apply brackets: Factorise 3m+3 3 is the common factor So 3m+3=3(m+1) 2x-ax=x(2-a) The common factor goes outside the brackets. Factorise mx-nx+6x=x(m-n+6) 49ds-7ps+21as=7s[7d-p+3a] There 7 is a factor of 49 as 7*7=49. It's also a factor of 21 as 3*7=21. Another factor in that expression is s . So 7s, the two common factors, go outside the brackets and make 7s(7d-p+3a). The expression 2a+5 cannot be factorised because it has no common factor. Another expression without a common factor is a+4b. a+4b=a+4b x^3*x^5=x^8 Add the indices, the powers 3 and 5. Here a,x and 2 are all common factors. ax^2[x^2+a^2]=ax^4+a^2*x^2 ax^2*x^2=ax^4 ax^2*a^2=a^2*x*2 Wcalc needs values for the variables. -> #Solve this equation ax^2[x^2+a^2]= -> #when a=6 and x=5 -> 6*5^2[5^2+6^2] = 1.12847e+86

Wcalc has answered in scientific notation, with an e, instead of decimal notation.

To change scientific notation to decimal: eg -> log 1.12847e+86 = 86.0525 ->

To simplify expressions and solve equations by inversion logic: -> # Solve 5[2a+1]=4[3a-1] 10a+5=12a-4 a+5=(12a-4)/10 So a=[(12a-4)/10]-5 -> #So a=-5.4/1.2 -> -5.4/1.2 = -4.5 -> The right answer is 4.5, a=4.5 -> -5.4/-1.2 = 4.5

-> Two minuses in division or multiplication make a plus.

Invert the algebraic expression to separate the pronumeral.

A formula is different from an equation in that letters are replaced by numbers to calculate an answer.

eg The area of a rectangle equals its length times its width. The formula for that is a=lw or a=l*w A dance floor measures 6 metres by 12 metres. -> 6*12 = 72 ->Its area is 72sqm.

A box measures 11cm x 8cm x 7cm. What is its volume. v=l*w*d

Numerical values are substituted for the letters of the formula. -> 11*8*7 = 616 -> That's 616 cubic cm. Formula: p = 5xy/1000 x=20, y=2 -> 5*20*2/1000 ~= 0.2 -> Answer: p=0.2 h=3/4xyz^2 x=3, y=2, z=1 h=3/4*3*2*1^2 -> 3/4*3*2*1^2 = 4.5 -> That is the right answer, h=4.5

A power belongs to the number next to and before it unless brackets change that. -> 3/(4*3*2*1)^2 = 0.00520833 -> 3/4*(3*2*1)^2 = 27 -> 3/4*3*2*(1^2) = 4.5 -> 1*1 = 1 ->

Wcalc also runs from the Terminal command line.

To run a mathematical expression, use single quotes around the expression and brackets around the variable: eg $ wcalc 'log(8)' = 0.90309 user:~$ wcalc 'log(10)' = 1 user:~$ wcalc 'log(2)' = 0.30103 user:~$ user:~$ wcalc -P20 pi = 3.14159265358979323846

Options start with a hyphen - , as above. Wcalc is case sensitive, so capital P. user:~$ There the 20 tells calc to show up to 20 decimal places in the answer. user:~$ wcalc 'sqrt(8)' = 2.82843 user:~$ wcalc 'ln 5' = 1.60944 user:~$ There wcalc shows the logarithum number ln for the base 5, n=5.

To calculate from the Terminal command line, start the sum with wcalc: user:~$ wcalc 4*9238 = 36952 user:~$ wcalc 2.82843^8 = 4096.03 user:~$

To run wcalc in interactive mode again, type wcalc on the command line of Terminal: $ wcalc

Enter an expression to evaluate, q to quit, or ? for help: ->

To paste a table into the command line of Wcal, copy and paste it: -> ... ABCWP 1/30/2008 33 1249 ABCWP 1/30/2008 33 0 ABCWP 2/28/2008 32 0 ABCWP 4/10/2008 33 1197 CBSNYT 2/10/2001 53 1124 CBSNYT 3/8/2001 60 1105 CBSNYT 4/4/2001 53 660 CBSNYT 4/23/2001 56 921 CBSNYT 5/10/2001 57 1063 CBSNYT 6/14/2001 53 1050 CBSNYT 8/28/2001 50 8506 CBSNYT 9/11/2001 72 1041 ... ^

Type some blank spaces into the table to line up the numbers in the columns. There are four columns above: variablename, with no blanks; date, format shown; index variables; and number of cases.

Zero or N means unknown.

Data in a text file can be delimited by tab, space or comma.

Wcalc accepts a header line as the first line at the top of a table, without using it in any calculation. https://stimson.web.unc.edu/wp-content/uploads/sites/9919/2015/08/Wcalc6.pdf

To paste output from Wcalc into Gedit text editor for a table: -> 8+3+4+6+14+0+17+12 = 64 -> 11+3+2+0+6+9+4+10 = 45 Edit the rows and add a title and labels.

Player performance Scores Albert 8+ 3+ 4+ 6+14+ 0+17+12 = 64 Jason 11+ 3+ 2+ 0+ 6+ 9+ 4+10 = 45 Best player is Albert. Mean 7 Mode 17 Median 6 Minimum 0

To calculate statistics from table: -> (64+45)/16 = 6.8125 ->

To find the median score, arrange all scores in numerical order. 0+0+2+3+3+4+4+6median+6+8+9+10+12+11+14+17+ -> 16/2 = 8 -> (6+6)/2 = 6 ->

To format the table and remove the + signs in it:

Copy the table and paste it into a new window of the editor.

Click the three-line button at top and select find and replace.

Find + and replace with pipe |. Pipe is shift \. Replace all.

The table now looks like this -

Player performance Scores Albert 8| 3| 4| 6|14| 0|17|12 = 64 Jason 11| 3| 2| 0| 6| 9| 4|10 = 45 Best player is Albert.

Copy and paste the formatted table wherever it is to go and save it.

The W in Wcalc is for Windows. This is version 2.5 and the latest version is 6.

To make a table of statistics: In Wcalc, list variables horizontally and add them up. -> # Make a table using a text editor. Find the biggest number, the mode, to set the tabulation by. -> 1+3+2+4+221 = 231 -> Copy and paste the variables. 1+3+2+4+221 Var 1 3 2 4 221 ___ Total 231

The variable name, the mode 221 or the total 231 determins the width of cells in a column. Repeat that for the next column of variables. Type a title over the top line of the table. Copy and paste the table into a text editor and save the file. Table of variables Var 1 3 2 4 221 ___ Total 231 The median number is 2. The average is 231/5=46 -> 231/5 = 46.2 -> Copy more variables from wcalc and paste them into the table in the text editor. -> 10+3+101+9+47 = 170

Days late for work in 2023 and 2024 2023 2024 Avg Kelvin 1 10 6 Alice 3 3 3 Norman 2 101 52 Mary 4 9 7 Rodney 221 47 134 Total days absent 401 in two years -> 231+170 = 401 Average number of days lost a year 200. -> (2+101)/2 = 51.5 -> (221+47)/2 = 134 -> Percentage of days lost 35% -> (52-6)*5*5 = 1150 -> 401/1150*100/1 = 34.8696 -> round 34.8696 ~= 35 -> -> #That is 52 weeks a year less 6 weeks holidays, times 5 working days a week, times 5 employees and 401 out of 1150 days lost.

To set Wcalc calculator to engineering mode, run a backstroke command \: -> \e Engineering notation is always used ~= 1.224876e+02 user:~$ wcalc '\e' Engineering notation is always used ~= 0.000000e+00 user:~$ wcalc \e ~= 2.71828 user:~$ wcalc e ~= 2.71828

Sometimes a command in Terminal for Wcalc works without inverted commas or without even a backstroke. But it is safer to always use '\command' eg '\e' user:~$ -> \eng Engineering notation is never used ~= 122.487600 user:~$ wcalc '\eng' Engineering notation is always used ~= 0.000000e+00 user:~$ or -> \engineering Engineering notation is used if convenient ~= 122.488 -> user:~$ wcalc '\engineering' Engineering notation is always used ~= 0.000000e+00 user:~$

To set wcal for decimal output, dec mode: -> \d Decimal Formatted Output ~= 0 -> \d Decimal Formatted Output ~= 122.488 -> user:~$ wcalc '\d' Decimal Formatted Output ~= 0 user:~$ -> \dec Decimal Formatted Output ~= 0 user:~$ wcalc '\dec' Decimal Formatted Output ~= 0 user:~$ or -> \decimal Decimal Formatted Output ~= 0 -> user:~$ wcalc '\decimal' Decimal Formatted Output ~= 0 user:~$

Wcalc output in scientific, engineering or decimal mode looks like this, with an e in the answer: Equation -> 6*5^2[5^2+6^2] Answer = 1.12847e+86 Scientists usually use a different decimal format than engineers.

To set engineering output on auto: user:~$ wcalc '\e' Engineering notation is always used ~= 0.000000e+00 user:~$ Engineering output is shown always on automatic in preferences. eg user:~$ wcalc 35.9386/2.9 = 12.3926 user:~$

For use in general, leave Wcal on automatic default settings.

To show preference settings for wcalc: \pref -> \pref Display Precision: -1 (auto) -> \p Internal Precision: 1024 -> \bits Engineering Output: auto -> \e Output Format: decimal format (9) -> \b, \d, \h, \o Use Radians: no -> \r Print Prefixes: yes -> \pre, \prefixes Avoid Abbreviating Integers: no -> \ints Rounding Indication: yes (simple) -> \round Save Errors in History: no -> \re Thousands Delimiter: ',' -> \tsep Decimal Delimiter: '.' -> \dsep Precision Guard: yes -> \cons History Limit: no -> \hlimit Verbose: no -> \verbose Display Delimiters: no -> \delim Modulo Operator: C-style -> \cmod ->

To run a command in Wcalc: At the -> command line, type \ followed by the command. eg \p2 There is nothing between -> and \ and there is no - hyphen. That option tells wcalc to output answers to two decimal places. The p is for precision places. -> \p2 Precision = 2 = 0 ->

This sum was answered to three decimal places before changing p and two places after changing to \p2 . -> 4*30.6219 = 122.488 -> 4*30.6219

Two decimal places is handy for calculating amounts of money. -> 561+729 = 1290.00 -> # $1290.00 Logarithms are often 4 decimal places: -> \p4 Precision = 4 ~= 1.2392e+1 -> \pref Display Precision: 4 -> \p

To change the number of decimal places shown in the output in wcalc, run the command \pn where n is the number of decimal places wanted: eg /p2

To set the number of decimal places back to the default, run the precision command \p-1 -> \p-1 Precision = auto ~= 1290 -> 4*30.6219 = 122.488 ->

That answer has only 3 places. Wcalc handles up to 9 decimal places if the answer has that many. = 122.49 ->

Wcalc by default shows results in decimals, base 10. When precision option p is set at -1, Wcalc by default is set to auto-adjust the number of decimal places to suit the output.

Matrices are rectangular arrays of numbers or symbols which are arranged in rows and columns, like in tables.

To multiply one matrix with another: Multiply a row from the first matrix with a column from the second.

In Wcalc, it's easier to write the column horizontally without brackets. -> # (2 3 1) 15 40 20 -> 2*15 = 30 -> 3*40 = 120 -> 1*20 = 20 -> 30+120+20 = 170 -> # 170 is matrix (170).

Graph tools user:~$ sigma Command 'sigma' not found, but can be installed with: sudo apt install sigma-align user:~$ graph Command 'graph' not found, but can be installed with: sudo apt install plotutils user:~$

To draw a graph:

On the command line in Terminal type the command: gedit

Use Gedit to draw a histogram such as a column graph or line graph.

A graph is usually based on a vertical axis called y and a horizontal axis called x. If time is plotted on a graph, it is usually on the horizontal x axis. The two axes meet a zero 0.

Start drawing by finding the height needed for the vertical axis, the item access. In this graph it is 5 units. Press the pipe and line keys to draw the axes. Type a hyphen to plot each point on the graph.

Line graph

Number of trucks sold each month 5| - 4| - - 3| - - - 2| - - - 1| - - 0|_____________________ -__________________ Ja|Fb|Mr|Ap|My|Jn|Jl|Au|Se|Oc|Nv|De| Year Counted on 1st day of next month.

The mode there is 5 trucks sold in June. The minimum is no trucks sold in August.

For a line graph, draw straight lines to join the points. For a column graph, draw a straight lines down from each point vertically to the time axis.

To draw a pie chart:

A compass, ruler and protractor are used here.

Draw a circle, mark its centre and draw a straight line from the centre up to the circumference.

A circle is 360 degrees. So segments in the circle will be less than > 360 and add up to 360. One percent 1% is 3.6 degrees. "100=360 so 1=360/100=3.6 "

; "A pie chart for colour mixing is to show 30% white, 45% yellow, 25% blue." ; 30*3.6 108 ; 45*3.6 162 ; 25*3.6 90 ; 108+162+90 360 ; Draw segments of 108, 162 and 90 degrees and label them white, yellow and blue. Type the title Colour Chart.

To calculate many percentages in Calc: Let p for pie = 100 ; p=100 ; p 100 ;Multiply the fraction or ratio by p. ; 108/360*p 30 ;; 108/360*p 30 ; 162/360*p 45 ; 90/360*p 25 ;

Sigma means add

The sigma sign E is a capital S in Greek. In a maths formula, the sign says to add or sum up numbers. An x stands for a number, an n is for a number of numbers and an x bar means average or mean. A formula can be written instead without jargon.

Formula av=x+x+x+x+x/n There n=5 and the numbers being averaged are separated by + signs instead of commas. That is how the formula can be written for Calc or Wcalc calculators.

Abbreviations can be: avg=average or mean, x=number, n=number of variable numbers, med=middle number or median, mod=mode or most frequent number. That is avg,med and mod.

Statisticians measure a distribution of numbers by its variance around a location of average, median and mode. R=range, the spread of numbers from the lowest to the highest. r=xmax-xmin

To move to the next topic in this file, or skip a topic, do a case-sensitive search for the word To .

To average a group of numbers, add them up and divide by the number of numbers.

To find the range of the numbers, subtract the lowest number from the highest.

Outliers are numbers which are far above or below the other numbers in the range. They are usually the highest or lowest numbers in the range, or distribution.

To find the how much a number x deviates from the average avg, subtract it from the average: Here the average or mean of ten numbers is 7. One of the numbers is 5. -> 7-5 = 2 -> So the deviation d of that number is 2. Another number in the distribution is 9. -> 7-9 = -2 -> That deviation is 2 also, not -2, because the number is still 2 away from avg 7.

To calculate the average deviation of numbers in a spread or distribution, treat negative deviations as positive, add all the deviations then divide the answer by the number of numbers in the distribution: -> 2+1+1+0+1+2+1+2+1+3 = 14 -> 14/10 = 1.4 -> The mean deviation is 1.4 The formula for that is d=x-avg/n

To allow for outliers in the variation spread, calculate the standard deviation:

Statisticians called the adjusted figure a variance and give it the symbol o^2, o squared. Then they reverse the square with a square root, ^/. The formula for standard deviation in Wcalc is like this o=^/(x-avg)^2/n-1 eg Find the standard deviation of this set of scores: 12+9+6+5+8 -> 12+9+6+5+8 = 40 -> 40/5 = 8 -> -> 12-8 = 4 -> 9-8 = 1 -> 6-8 = -2 -> 5-8 = -3 -> 8-8 ~= 0 Square each deviation as a positive number. -> 4^2 = 16 -> 1^2 = 1 -> 2^2 = 4 -> 3^2 = 9 -> 0^2 = 0 -> -> 4^2 = 16 -> 1^2 = 1 -> 2^2 = 4 -> 3^2 = 9 -> 0^2 = 0 -> (16+1+4+9+0)/5 = 6 -> sqrt 6 = 2.44949 The standard deviation d or o is 2.5

-> #Wcalc understands sqrt whereas Calc understands ^/ to mean square root. ->

The formula for standard deviation looks like -># o=^/[s(x-avg)^2]/n

There the s stands for sigma or sum.

To see if a sigma program is installed for Linux operating system: Run this command in Terminal: sigma user:~$ sigma Command 'sigma' not found, but can be installed with: sudo apt install sigma-align user:~$ and user:~$ wcalc Enter an expression to evaluate, q to quit, or ? for help: -> sigma ~= 5.6704e-08 ->

To use the averaging formula in Wcalc: -> #avg=(1+2+3+4)/4 -> (1+2+3+4)/4 = 2.5 -> Parentheses () are needed around the number to be added.

A graphic calculator shows the back-to-front E sigma sign with the highest number above and the lowest number below. Type the numbers separated by + signs or commas into the field.

A sequence is a set of numbers in order.

To calculate with negative - numbers in statistics, think of a ruler with negative numbers on it. Zero is in the middle of the ruler, positive numbers go to the right of zero and negative to the left. If the ruler is vertical, negatives go below the zero.

Think of the calculations as being on the ruler or axis. -> 5+7 = 12 -> 5+-7 = -2 ->See that the +- makes a minus there because 5 minus 7 is minus 2. -> 5+-1 = 4 ->The answer is positive that time because 5 less 1 is 4. -> -3+6 = 3

-> So negative numbers follow logic, not just rules.

In statistics the distance or divergence d of a number from an average of numbers is the distance from the average, not from zero. So if the average is 5 and the number is -4 then the distance between them is 9. The -4 counts as a +4. Think of the ruler. That's logical.

To add a distribution or array of positive and negative numbers in statistics: eg -> # Distribution 7-3+2+8-1+0 -> (7-3+2+8-1+0)/6 = 2.16667 -> # Average 2.1667 -> # Let a=2.1667 -> a=2.1667 display_val adisplay_val = 2.1667 Here Wcalc misreads the = so use Calc instead. ; 'Let a = the avg' ; a=2.1667 ; a 2.1667 ; -> # Divergences ; a-7 -4.8333 ; a-3 -0.8333 ; a--2 Missing operator ; a-2 0.1667 ; a-8 -5.8333 ; a-1 1.1667 ; a-0 2.1667 -> # Rounded divergences -4.8+0.2+0.8+5.8+2.2 4.8+0.8+0.2+5.8+1.2+2.2 -> # Average divergence -> 4.8+0.8+0.2+5.8+1.2+2.2/6 ~13.16666666666666666667 ; That answer is wrong because the equation needs parentheses. ; (4.8+0.8+0.2+5.8+1.2+2.2)/6 2.5 ; Average divergence 2.5

To multiply and divide negative numbers: ; 5*5 25 ; 5/2 2.5 ; 5*-5 -25 ; 5/-2 -2.5 -> 5^2 = 25

There the command line starts differently because Wcalc is being used instead of Calc. -> -5^2 = -25 -> sqrt -25 = Not a Number

The square root of a negative number is not a real number. ->-> sqrt 25 ~= 5 -> -25/-5 = 5

-> When a negative - number is divided by another negative number, the answer is positive. In that example, -5 goes into -25 five times. That is logical. -> -25/-25 ~= 1 -> Minus 25 goes into -25 once.

The square root of a number is a number whose square is that number. -> sqrt 9 = 3 -> 3^2 = 9 ->-> -3^2 = -9 but -> sqrt -9 = Not a Number

Square roots of negative numbers do not exist in real numbers. They do exist in complex numbers using the imaginary unit i. Every real number, positive of negative, when squared is positive. Sometimes imaginary i numbers are used in complex higher mathematics. They can be used to compute the square root of negative numbers. The imaginary i:=√−1 so i^2=−1.

The square root symbol as shown below is called a radical. Most computer keyboards do not have a radical key.

If a is not negative, ->(√a)^2 = a -> sqrt (9)^2 = 9 ->

So squaring the square root of a number gives that same number back as the answer.

Calc recognises ^/ instead of a radical sign. The sign goes after the number and ends with the power like n^/2 . eg ; 9^/2 3 ; -9^/2 -3 ; -3*-3 9 ; 3*-3 -9 ; 3*3 9

; As 3*3 is 9, -3*-3 cannot logically be 9 too. But in statistics when the distance of a number from the average or from zero is being calculated, 9 is the right answer. In science and high mathematics it is gives an imaginary number for an answer.

eg ; -5^/2 -2.23606797749978969641 ; -2.23606797749978969641^2 ~-5.00000000000000000000 ; -2.23606797749978969641*-2.23606797749978969641 ~5.00000000000000000000

; Calc says that the square of -2.2 is -5 but that -2.5 times -2.5 is +5. That's not logical in terms of real numbers.

To learn how to use a hand-held scientific calculator, see https://www.wikihow.com/Operate-a-Scientific-Calculator

To learn how to use a command-line calculator on a desktop or laptop computer, search this file.

A set is a group of numbers, just as a flock is a group of birds or a herd is a group of cattle. A progression or series is a sequence of numbers which follow a fixed pattern. Two types of progressions are the arithmetic and the geometric. Numbers in an arithmetic progression are all the same numerical distance apart, the same difference between each number. Numbers in a geometric progress are all the same ratio apart.

eg In the progression 7,11,15,19,23, the numbers or terms are a difference of 4 apart. 7+4=11

eg In the progression 3,6,12,24,48, the common ratio between each term is 2. 3*2=6

A number in a progression is called a term. Type t for term. Call the first term in a progression a . Call the term before a term p for previous term. Call the common difference d and the common ratio r. Type s for sum of sigma. t = term a = first term p = previous term l = last term d = common difference r = common ratio n = number of terms s = sum of terms

To calculate the common difference between any term and the next term: The formula is d=t-p In the example above, d=23-19. ; 23-19 4 ;Difference 4

To calculate a missing arithmetic term: t=a+d ; 11+4 15 ;The next term in the progression is 15.

To add up a number of terms: s=n/2(a+l) s=5/2(7+23) ; 5/2*(7+23) 75 ; or 7,11,15,19,23 7+11+15+19+23 ; 7+11+15+19+23 75 ;

A transcendental number is often expressed as the sum of a progression or series.

To calculate a common ratio: r=t/p r=24/12 ; 24/12 2 or ; 12/6 2 ;

To calculate a geometric term: t=a*r t=3*2 12/6

; "To build a geometric progression or series:" ; "Here the first term is 3, the number of terms is 5, and the ratio is 2." ; 3*2 6 ; Press the up arrow key to repeat the last calculation. Multiply by the ratio again. ; 3*2**2 12 ; 3*2**2*2 24 ; 3*2**2*2*2 48

; "If the ratio is more than one digit, save it to memory." ; r=3678 ; r 3678 ; 3*r 11034 ; 3*rr "rr" is undefined ; 3*r*r 40583052 ; 3*r*r*r 149264465256

To add geometric terms: eg 3,6,12,24,48, 3+6+12+24+48 ; 3+6+12+24+48 93

eg Another arithmetic series of terms begins with 12, 16, 20 and has a total of 22 terms. So a=12, n=22 and d=16-12=4. The l last term is not known yet. The formula for adding up the total of terms is S=n/2*(a+l) ; 16-12 4 ; 22/2*(12+l) "l" is undefined The formula for l is L=a+(n-1)d l=12+(22-1)*4 ; (22-1)*4 84 ; 12+84 96 ;; 22/2*(12+96) 1188 ;The sum of terms is 1188. The sum formula altogether is s=n/5[2a+(n-1)d]

The program used there is installed as apcalc. It runs in Terminal with the command calc.

Calc understands one set of parentheses or brackets but not both together. ; l=a+(n-1)*d "a" is undefined ; 12+(22-1)*4 96 ; s=22/2*12+(22-1)*4 ; 22/2*12+(22-1)*4 ; 22/2*[2*12+(22-1)*4] Left bracket with no preceding lvalue So break the calculation into parts as done above or use Wcalc instead. -> 22/2*[2*12+(22-1)*4] = 1188 -> Wcalc handles parentheses inside square brackets.

To use BC calculator for basic arithmetic: user@hostC55A-TD3:~$ bc bc 1.07.1 /*This is a comment*/ 2*6 12 14/9 1 /*No decimal places*/ 14/7 2 3+-6 -3 sqrt 500 (standard_in) 7: syntax error 500 sqrt (standard_in) 8: syntax error /*This version of BC does not recognise a sqrt square root expression.*/ sqrt number (standard_in) 10: syntax error sqrt 81 (standard_in) 11: syntax error 81^/2 (standard_in) 13: syntax error 5^/2 (standard_in) 14: syntax error quit user@host:~$

Calc recognises ^/2 and ^/10 and Wcalc recognises sqrt; see above.

To calculate the probability of an event happening:

P = probability that the event will happen,

S = total number of samples which may or may not result in the event

and E = total number of samples which do result in the event. Divide E by S to calculate the probability expressed as a fraction. p=e/s

When calculating on a command line, use lower case letters to save pressing the shift key.

Probability equals the number of favourable outcomes divided by number of possible outcomes. P=E/S

In results of probability, an event that is sure to happen has a probability of one 1 and an event that surely will not to happen has a probability of zero 0. An event that has a 50% chance of happening has a probability of 1/2. An event with a larger fraction of probability has a higher chance of happening.

eg Ten cards numbered 1 to 10 include three cards that are divisible by 3, cards 3, 6 and 9. p=e/s p=3/10 So one card chosen from the 10 samples has a 30% chance of being a 3, 6 or 9.

eg In a class of 30 students, 8 have black hair and 10 have blonde hair. p=e/s 30 is the sum of all the samples. 10+8=18 18 is the number of students or events who have either black or blonde hair. p=18/30=3/5 Probability is 3/5. 30-18=12 12 students have neither black nor blonde hair and so are excluded from the calculation. They are 12 excluded events.

Ten marbles are in a bag, 7 of them are red and 3 green. What is the chance or probability of picking a blue marble out of the bag in one draw? p=0/10=0 Probability zero. Another bag holds 12 marbles, all blue. What is the chance of randomly drawing a blue marble? p=12/12=1 Probability 1 means a 100% sure chance.

eg What is the chance of throwing any number higher than 4 with one roll of one dice? The only higher numbers are 5 and 6. p=e/s 2/6=1/3 Probability 1/3

The range of probabilities can be described as certain 1, likely, even chance 1/2, unlikely or impossible 0.

To calculate the probability that several events will happen, multiply the probabilities: P=p*p*p The probability of tossing a head when tossing a coin once is 1/2. That is one head chance event out of 2 sample sides, head and tails. p=1/2 The probability that a head will be tossed on the first, second or third tosses is 1/2. The probability that three heads will be tossed in three throws is calculated with the product rule P=p*p*p P=1/2*1/2*1/2 ; 1*1*1 1 ; 2*2*2 8 P=1/8 Half of a half is a quarter and half of a quarter is an eighth.

To calculate the probability that two or more events combined will lead to a favourable outcome, draw a tree diagram of the first event leading to the next event and so on. A diagram helps to avoid omitting a sample.

Algebra is arithmetic with letters to stand for unknown or variable numbers. An algebraic expression is a numerical expression with letters. A formula like a = l * b, for area equals length times breadth, is an expression. A stands for an unknown number and l and b stand for variable numbers. Variables are called pronumerals. The variables are added into the expression to find the answer to the expression. An answer is called a value, as in finding the value of a.

eg Find the area of a rectangle measuring 7 metres by 5 metres. a=l*b is the pattern or formula ; 7*5 35 ;The area is 35 square metres. As in arithmetic, letters are also used to abbreviate words, as in 35sqm.

To describe a pattern of numbers in algebra: Here the pattern is 1+1+1=3*1 and it repeats as one 1 is added to the previous number like this 2+2+2=3*2 Algebra describes the whole pattern in one sentence with a letter for the variable. a+a+a=3*a If a is 5, numeral 5 is substituted for pronumeral a. ; 5+5+5 15 ; 3*5 15

; Signs like +,-,* and / are the same in algebra as in arithmetic. But the multiplication sign * or x is usually omitted, as in 8abc=8*a*b*c

So the letter x can be used as a pronumeral, not a times sign.

eg What is the value of the expression 5xy when x = 4 and y =9 ? 5xy=5*4*9 ; 5*4*9 180 ; Value 180.

To calculate a pattern with 2 variables in it: A number pattern or formula can have two different variables in it. Here the variables are called pronumerals t and n. t=3n-2 The calculation is written in Calc calculator as 3*n-2 In this pattern, variable n is the number 1 to 6. Find the value of 3. eg t=3*6-2 ; 3*6-2 16 ; Calc works from left to right unless parentheses tell it to do otherwise. ; 3*(6-2) 12

There calc does the subtraction in brackets first then the multiplication. But that is a different sum which gives the wrong answer for the pattern.

To calculate with ordered pairs of numbers or co-ordinates: A theatre for example may have its rows of seats numbered 1 to six and its rows numbered A to D. All the seat numbers can be written as a pattern of numbers in a table. A seat can be named by co-ordinates written with pronumerals like (x,y) or (A,B). The co-ordinate of a seat, say 4C, is written in brackets like this (4,C)

Co-ordinates are called ordered pairs of numbers. They are called ordered because a pair of numbers has to read from left to right to find the right location or other value.

Co-ordinates can me written as on a graph to mark points. A graph usually has a vertical y axis and a horizontal x axis with the two axes meeting a zero. Two points on a graph are labelled left to right (x,y) as (1,2) and (4,5). Those numbers in brackets make two ordered pairs. The variables in any ordered pair are called x and y, (x,y), in that order.

Any set of ordered pairs is called a relation.

A function is a relation in which for every value of x there is only one value of y.

No two ordered pairs of a function have the same first number.

All the points on a graph of a function run in a straight line.

eg A function rule is 2x-1. Use that function to make a set of ordered pairs. Function 2x-1 X = 1 to 5. "2x-1" ; 2*1-1 1 ; 2*2-1 3 ; 2*3-1 5 ; 2*4-1 7 ; 2*5-1 9 ; "So the co-ordinates of this function are (1,1) (2,3) (3,5) (4,7) and (5,9)" Those pairs plotted on a graph make a straight line.

The letter f stands for function and the function rule is written like this example f(x)=x+2. Function x equals x plus or minus whatever. egs f(x)=2x+2 f(n)=n+5 f(x)=3n-1 or f(n)=n2+1

The group of all the numbers used for x is called a domain. If the domain is 0, 1, 2, 3, 4, 5, those are the values for x or n in the function. In any relation or function, the domain is the set of variables to replace the pronumeral in the formula or rule. A domain can be described like this Domain x = (1,2,3,4)

The values calculated using a function rule is call a range. The group of all the values or answers can be written like this Range y = (3,6,9,12) Domain x and range y numbers are paired to make a table or co-ordinates for a graph.

Spreadsheet Calculator SC runs with the Linux command line.

To run Spreadsheet Calculator: sc In Terminal, username@:~$ sc A blank spreadsheet opens in Terminal. Press shift-? for help. Never run SC as root user.

To close or exit SC, press q for quit. Do you want to save the data? Press n for no or y for yes. Or press enter then q.

To install Spreadsheet Calculator: username@:~$ sc Command 'sc' not found, but can be installed with: sudo apt install sc username@:~$ sudo apt install sc [sudo] password for wes7: Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically install etc

To learn how to use SC: Start sc, see an empty spread sheet with a command line at the top, type a question mark, shift-?, press the a key then b and c through to p to learn and practise the commands.

To move the cursor to another cell or co-ordinate, press the arrow keys.

To go to a cell, type its co-ordinates: g coordinates eg g b7

A co-ordinate, or cell address, is a combination of a letter from the top row and a number from the left column to pinpoint a cell. Column names are not case sensitive.

To go to a word or regular expression: g "typed words" in quotes eg g " Tax table ".

To go to a number: g number eg g 238

To insert a row or column into the spreadsheet, press i then r or c.

To type a number into a cell: Press the arrow keys to highlight the cell. Press the e key. Type the number then press enter.

To enter a numeric constant or expression into the currently highlighted cell: Press the equal key = then type the number at the prompt on the top line.

To type enter a label string into the current cell: Type < followed by a word or words.

To left justify a word in the current cell, press the curly bracket key, { , shift-bracket.

To erase delete a number from a cell: Press arrow keys to highlight the cell. Press x key then enter key.

To go back to the i> prompt, press enter. See cursor flashing.

To open SC with a tutorial about the spreadsheet calculator, run this command in Terminal: sc /usr/share/doc/sc/tutorial.sc Drag the screen wider to read lines. or try sudo gunzip /usr/share/doc/sc/tutorial.sc.gz

To scroll the tutorial document, click it with the mouse then press the down arrow key.

To scroll a document page by page, press the pageup amnd pagedown keys.

Cells can contain numbers, formulas or text. To show what is in a cell, highlight the cell. Its contents is shown between backets at the top left of the screen.

To type data into a cell: Highlight the cell then type To draw a horizontal line, leave or insert a blank line instead.

To edit a cell: Press e to edit a number of cap E to edit a string.

To put P the data from a spreadsheet into a file: P filename

To show get G data from an sc file: G filename

To show a clear text version of the file, run the write command W: W filename.txt

To merge M data from a saved sc file with the current sc file on screen: M filename

To show the user manual for SC: In Terminal, run $ man sc Widen the window to show end of lines. Press the down arrow key to scroll.

Options begin with a hyphen - See the manual for options and defaults.

To enter navigation mode: Control-V ^V v That mode is for navigating the spreadsheet while editing a command.

To move back a character: ^H Ctrl-h

To finish editing cells, press the ESC escape key.

To go to the last column, press $ dollar: Shift-$

In navigation mode, press 0 to go to column zero 0

To go revert back to edit or replace mode, press R.

To delete the character to the left, press X.

To delete to the beginning of the line, press d

To go to a cell in navigation mode: g

SC modes are: edit, navigate, insert and replace.

To stop editing: q

To undo: u

To type a string word into a cell, start and end it with double quote marks.

To format a number into scientific notation: E- E+ e- e+

To read another tutorial about SC, go to https://www.linuxjournal.com/article/10699


Calculating with Linux
Copyright C Wallace William Baker 2024. All rights reserved.
Published by Postbox22.com, Sydney, Australia





Top

Home


Free Web Hosting