Wikipedia

Search results

Tuesday, 2 November 2021

Algebra

 Algebra is about finding unknown variables in equations and then solving them


Algebra helps better  handle problem involving numbers.


Example

A person given a bag of unknow soaps.

He sold 37 soaps  still 10 soaps remained in bag.

Find total soaps.


sol:

x-37=10

x=37+10=47

(or)

x-37=10

Add 37 on both sides to isolate x

37+x-37=10 +37

x=47


Types of algebra:

    Linear - Focus on solving linear equations like y=mx+c

    Boolean :- Focus on boolean values

    Computer :- Focus on algorithms

    Relational:- Takes a r/s as input and product a r/s as output.

    

Linear Equations usage in every day life

Linear equations use one or more variables where one variable is dependent on another.

If there is an unknown quantity it can be represented by a linear equation.



Example: Variable costs

    A taxi charges 50 rupees for 5km.  Beyond that it charges 25 rupees/km. 

You want to go some destination without knowing how many miles?

Represent this as a linear equation?


sol:

Let x be unknow km

y=charge

y=25*x+50


Example2:

A party has limited budget for an upcoming event. If cost of rental space is 50000/- and meals plate is 100 rupees.

Find out total budget for unknow persons coming to event (x) ?

sol:

 y=100 x + 50000


Friday, 27 August 2021

Graphs using matplotlib for pandas data frame

 import pandas as pd
import matplotlib.pyplot as plt

df=pd.DataFrame({"X":[0,2,4,6,8]})


df.plot(style=['r*-'])


#'r*-' is called formatting string

#Formating string syntax is ['marker''Line''Color']
# r   -->red color
# *   --> marker
#     - --> solid line

plt.show()




Formating string syntax is ['marker''Line''Color']

Marker
'.' point marker

',' pixel marker

'o' circle marker

'v' triangle_down marker

'^' triangle_up marker

'<' triangle_left marker

'>' triangle_right marker

'1' tri_down marker
'2' tri_up marker
'3' tri_left marker
'4' tri_right marker
'8' octagon marker

's' square marker

'p' pentagon marker

'P' plus (filled) marker

'*' star marker

'h' hexagon1 marker

'H' hexagon2 marker

'+' plus marker

'x' x marker

'X' x (filled) marker

'D' diamond marker

'd' thin_diamond marker

'|' vline marker

'_' hline marker



Line Styles

character description
'-'                 solid line style

'--'                 dashed line style

'-.'              dash-dot line style

':'                 dotted line style



Colors

character color
'b'                blue

'g'                green

'r'               red

'c'              cyan

'm'            magenta

'y'              yellow

'k'              black

'w'                 white