Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
27 views
Python
Uploaded by
aakankshakelkar123123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python For Later
Download
Save
Save Python For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
27 views
Python
Uploaded by
aakankshakelkar123123
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Python For Later
Carousel Previous
Carousel Next
Save
Save Python For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 13
Search
Fullscreen
k 16 lim gsBitrary constant Example 2 : Investigate for what values of 2,11 the simultaneous equations xty+c26, xt2y+32=10, x+2y+dc=p have (i) no solution, (ii) a unique solution (iii) an infinite number of solutions. Solution : The matrix form of the given system of equations is J.R. INSTITUTE OF MATHEMATICS 189/35 BEHIND RAILWAY STATION, VAISH COLLEGE ROAD, ROHTAK PIN-124001 (HARYANA) E-mail us on - jrinstituterohtak@ gmail.com, balwanmudgilS4@ gmail.com Mob, 607383607, 9802177766 Page 5 x) [6 = 10|"B z] La The augmented matrix is [A: B] = Operating R,—>R,—R,, Ry-R,-R, | 6 ~|oO1 4 oOo. u-6 Operating R,—» R,-R, frag 6 ~|01 2 a4 [o 0 2-3): (@) The system will have no solution if pA: B] # AA) which is possible only if A=3 and ju #10. (ii) The system will have a unique soltition if, p[A: B] = p(A) = number of unknowns =3, which is possible only if 4 # 3 and ge is arbitrary. (iii) The system will have an infinite number of solutions if p[A : B] = p(A)
RR, RRR, 4 yaa [aca}- jon 2 036 Operating R,—+ R,—3R; friace -jo12:8 [ooo:o which isthe row echelon form ofthe matrix [4:8]. We have rank of [4:d] = the umber af oo-zeo rows in echelon form = 2. ‘Alo by the same cl mentary transformations, we et it ef a-|o12 000 rankot A=2. Since rank A= rask{A:B]=2- mumber of unknowns therefore’ We given equations me consist and will have an infinite mumber of sohtions ‘We see that the given system of equations ea) AB) =2, yo8-2k, c= i the general solution ofthe given system, where aw a tas eatinba Exercise 1 1. ( Solve t xt pyres + Bes3y-r-Dwe? , dre Sy43e=7 ‘whether the following system equations is consistent or mot dey s Uroytre6 de-ys2ee7 , rey. 2. Check the consistency ofthe following system of equations and find the solstion if itis consistent: (@ dee3y4220-7 , Pee y—dz (i xe2ys3c44e=0, 2e+3y eared, Sxsdysr, 43. Check the consistency of the following system of equations and solve if it is consistent: 9 .xe2yes drec43e3 wx Des Tyslteeds, dx yo6r=16 , Sx-Sys3e=0 iy 2x-y432=3 , 2429 Tw=5 4. For what values of «and b do the system of equations AtyeSeeQ, x42y+3aab, xe3ysacet he @ m0 solution (8) unique sohtion (a) mingely many solutions, ‘5. Investigate the values of 2 and j1 so that the equations Was3y+Sea9, Tes3y-2ee8, Qesdyedzey ne (20 solution (i) unique solution (i) an infinite umber, jy 3 = Swed, 43yH 6, For what value of 2, the equations x+y+2=1, 442) 44204, x64y-4)02= solution and solve them completely in each case 17. Show that the equations -2r+y+z=a, x-2y+r=b, x+y-2rwe unless a+b+e=0 in which case they have infinitely many arhb=he=-2. fi -2-1 8, For what value of 2, docs the system | 3. — ot () m solation (i) enique soltion ) Solve the system of equations: Ax ¥2y— specially the case when = 2. 10, Determine whether each systems is linear (a) Bendy 2yce® () exs3yen (0) 2x-3yskend Axe dy-2=2, 6x46y+A2 = Sconsidering 11, Consider each of sytem i unknowns «and (@) x-ayat () ant 3y=2 (© xtaye3 ar W2esayad desSyab For, of a does cach system have a unique soltion, and fr which paits of values, b) system have more than oae sokstion ? (a) xt yeteed (©) x42y43203 2x4 3y 462-10 Des3y48ead 3rs6y+10c=17 Se48ys19c011 13. Consider cach of the following systems in unknowns xy, @) x-2y=t (by r42ye2cet (© xtysare! x atay+3e) tare?https://www.halvorsen.blog - Mathematics in Python Hans-Petter HalvorsenMathematics in Python Python is a powerful tool for mathematical calculations Python Standard Library — math Module — statistics Module NumPy Library Contents * Python Standard Library and Basic Math Functions * NumPy Library * Statistics * Trigonometric Functions * Polynomials * Complex NumbersCalculations in Python We can use variables in a calculation like this: y(x) = 2x +4 >a=2 >b=4 y(3) =? >x=3 >y = atx +b y(x) =ax+b > print(y) (5)=? |>x=5 * > y= atx +b) > print(y) Python Standard Library * Python allows you to split your program into modules that can be reused in other Python programs. It comes with a large collection of standard modules that you can use as the basis of your programs. * The Python Standard Library consists of different modules for handling file 1/O, basic mathematics, etc. * You don't need to install the modules in the Python Standard Library separately, but you need to important them when you want to use some of these modules or some of the functions within these modules.Basic Math Functions Some basic math functions in Some basic Examples: import math as mt Python Standard Library: + math.exp(x) + math. log(x) + math.10g10(x) + math.pow(x,y) + math. sqrt(x) 7 -pythi library/math.htm! Mathematical Expressions Let's create the following mathematical expression in Python: SQey) = 3x2 + fae Hy? + ete f(2,2) =? ‘The answer becomes f(2,2) = 16.83 Mathematical Expressions Let's create a function that calculates the following mathematical expression: f(xy) = 3x? + fxF $y? + eh Python Code: import math as mt def func_ex(x,y)+ a goes Pom a2) + mt.sqrt(mt.pow(x,2) + mt.pow(y,2)) + mt.exp(mt.1og(x))Python Code: Amport math as mt ef fune_ox(x,y) + rmt.pow(x,2) + mt.aqrt (mt pow(x,2) + mt.pow(y/2)) + mt.exp(at.log (x)) return £ xe2 y=2 f= fune_ex(x,y) print (#) NumPy * The Python Standard Library consists basic Math functions, for fore advanced Math functions, you typically want to use the NumPy Library * If you don’t have Python yet and want the simplest way to get started, you can use the Anaconda Distribution - it includes Python, NumPy, and other commonly used packages for scientific computing and data science. * Oruse “pip install numpy” https://numpy.orj NumPy In this example we use both the math module in the Python Standard Library and the NumPy library: Basic NumPy Example: import numpy as np x=3 {import math as mt import numpy as np y = np.sin(x) print(y) y = mt. sin(x) print(y) ‘As you see, NumPy also have also similar functions | y = ! n(x) (ee. sim), cost), etc.) as those whois part of the | primecy) ‘math library, but they are more powerful Mathematical Expressions {Let's create the following mathematical expression in Python using NumPy: P(xy) = 3x? + LaF y? + cme F(22) =? Python Code: Previously we used math in the Python Standard Library ‘import nuapy a= mp et fune_ex(x.y)¢ £5 JeMp-Power (x2) ¢ mp.sart(np.power(x,2) + np.poverty.2)) + npvexpinp-og(x)) ial f= tune exix.y) peine(e) —— ie aremer become ye Tee |Mathematical Expressions FL.) = 3x? + xt + y% + etme) | MPOFE nemPy 08 np def func_ex(x,y): f£ = 3+np.power(x,2) + np.sqrt(np.power(x,2) + -power(y,2)) + np-exp(ap.1og (x Let's find the values of f(x, y) for ey as iene oe O
x =? p(2) =? ———— 30-32/41 88 import numpy.polynomial.polynomial as poly Poly : Given the following pl = [1, 1, -1) p2 = [2, 0, 0, 1] polynomials: pi(x) = 14x—x? = e P = poly.polymul(pl, p2) pax) = 2423 Let's find the polynomial p(x) = Px(X) + p2(x) using Python And let's find the roots of the polynomial p(x) =0 Polynomial Fitting |
You might also like
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Mark Manson
4/5 (6127)
Principles: Life and Work
From Everand
Principles: Life and Work
Ray Dalio
4/5 (627)
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Brene Brown
4/5 (1148)
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
Chris Voss
4.5/5 (932)
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Jeannette Walls
4/5 (8215)
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Angela Duckworth
4/5 (631)
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
Jesmyn Ward
4/5 (1253)
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Stephen Chbosky
4/5 (8365)
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Phil Knight
4.5/5 (860)
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
Carmen Maria Machado
4/5 (877)
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Ben Horowitz
4.5/5 (361)
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Margot Lee Shetterly
4/5 (954)
Steve Jobs
From Everand
Steve Jobs
Walter Isaacson
4/5 (2923)
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
Ashlee Vance
4.5/5 (484)
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
Siddhartha Mukherjee
4.5/5 (277)
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Fredrik Backman
4.5/5 (4972)
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Frank McCourt
4.5/5 (444)
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
Colm Tóibín
3.5/5 (2061)
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
Garth Stein
4/5 (4281)
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
Sarah M. Broom
4/5 (100)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Meik Wiking
3.5/5 (447)
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Gilbert King
4.5/5 (278)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Thomas L. Friedman
3.5/5 (2283)
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
Roxane Gay
4/5 (1068)
The Outsider: A Novel
From Everand
The Outsider: A Novel
Stephen King
4/5 (1993)
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
Ruth Ware
3.5/5 (2641)
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
Betty Smith
4.5/5 (1936)
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
Viet Thanh Nguyen
4.5/5 (125)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Dave Eggers
3.5/5 (692)
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Doris Kearns Goodwin
4.5/5 (1912)
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
Hilary Mantel
4/5 (4074)
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Naomi Klein
4/5 (75)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Jay Sekulow
3.5/5 (143)
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
Jennifer Egan
3.5/5 (901)
John Adams
From Everand
John Adams
David McCullough
4.5/5 (2543)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
George Packer
4/5 (45)
Little Women
From Everand
Little Women
Louisa May Alcott
4/5 (105)
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel
John le Carré
3.5/5 (109)
Related titles
Click to expand Related Titles
Carousel Previous
Carousel Next
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
From Everand
The Subtle Art of Not Giving a F*ck: A Counterintuitive Approach to Living a Good Life
Principles: Life and Work
From Everand
Principles: Life and Work
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
From Everand
The Gifts of Imperfection: Let Go of Who You Think You're Supposed to Be and Embrace Who You Are
Never Split the Difference: Negotiating As If Your Life Depended On It
From Everand
Never Split the Difference: Negotiating As If Your Life Depended On It
The Glass Castle: A Memoir
From Everand
The Glass Castle: A Memoir
Grit: The Power of Passion and Perseverance
From Everand
Grit: The Power of Passion and Perseverance
Sing, Unburied, Sing: A Novel
From Everand
Sing, Unburied, Sing: A Novel
The Perks of Being a Wallflower
From Everand
The Perks of Being a Wallflower
Shoe Dog: A Memoir by the Creator of Nike
From Everand
Shoe Dog: A Memoir by the Creator of Nike
Her Body and Other Parties: Stories
From Everand
Her Body and Other Parties: Stories
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
From Everand
The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
From Everand
Hidden Figures: The American Dream and the Untold Story of the Black Women Mathematicians Who Helped Win the Space Race
Steve Jobs
From Everand
Steve Jobs
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
From Everand
Elon Musk: Tesla, SpaceX, and the Quest for a Fantastic Future
The Emperor of All Maladies: A Biography of Cancer
From Everand
The Emperor of All Maladies: A Biography of Cancer
A Man Called Ove: A Novel
From Everand
A Man Called Ove: A Novel
Angela's Ashes: A Memoir
From Everand
Angela's Ashes: A Memoir
Brooklyn: A Novel
From Everand
Brooklyn: A Novel
The Art of Racing in the Rain: A Novel
From Everand
The Art of Racing in the Rain: A Novel
The Yellow House: A Memoir (2019 National Book Award Winner)
From Everand
The Yellow House: A Memoir (2019 National Book Award Winner)
The Little Book of Hygge: Danish Secrets to Happy Living
From Everand
The Little Book of Hygge: Danish Secrets to Happy Living
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
From Everand
Devil in the Grove: Thurgood Marshall, the Groveland Boys, and the Dawn of a New America
Yes Please
From Everand
Yes Please
The World Is Flat 3.0: A Brief History of the Twenty-first Century
From Everand
The World Is Flat 3.0: A Brief History of the Twenty-first Century
Bad Feminist: Essays
From Everand
Bad Feminist: Essays
The Outsider: A Novel
From Everand
The Outsider: A Novel
The Woman in Cabin 10
From Everand
The Woman in Cabin 10
A Tree Grows in Brooklyn
From Everand
A Tree Grows in Brooklyn
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
From Everand
The Sympathizer: A Novel (Pulitzer Prize for Fiction)
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
From Everand
A Heartbreaking Work Of Staggering Genius: A Memoir Based on a True Story
Team of Rivals: The Political Genius of Abraham Lincoln
From Everand
Team of Rivals: The Political Genius of Abraham Lincoln
Wolf Hall: A Novel
From Everand
Wolf Hall: A Novel
On Fire: The (Burning) Case for a Green New Deal
From Everand
On Fire: The (Burning) Case for a Green New Deal
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Manhattan Beach: A Novel
From Everand
Manhattan Beach: A Novel
John Adams
From Everand
John Adams
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
The Unwinding: An Inner History of the New America
From Everand
The Unwinding: An Inner History of the New America
Little Women
From Everand
Little Women
The Constant Gardener: A Novel
From Everand
The Constant Gardener: A Novel