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)
19 views
Slip 5
Uploaded by
payalwani73
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Slip5 For Later
Download
Save
Save Slip5 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
19 views
Slip 5
Uploaded by
payalwani73
AI-enhanced title
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Slip5 For Later
Carousel Previous
Carousel Next
Save
Save Slip5 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 5
Search
Fullscreen
In SLIP 5 #Evaluate following expression on Python. 1,2,3,4], Find Length M, “xvZ"*"pqr”, Find L. #(c) s="Make In India’, Find (s[:7]) & (s[:9]). Me[1,2,3.4] print ("length ",len(M)) Letxyz"+"pqr" print(L) s="Make In India” print(s{:71) print(s[:9]) length 4 xYZpar Make In Make In 1 Use Python code to generate the square root of numbers from 21 to 49. import math print("square root of numbers from 21 to 49") for i in range(21,50): print(i,math.sqrt(i))square root of numbers from 21 to 4¢ 21 4,58257569495584 22 4,69041575982343 23 4,795831523312719 24 4,898979485566356 25 5.8 26 5.0990195135927845 27 5,196152422706632 28 5.291582622129181 29 5,385164807134504 30 5.477225575051661 31 5.5677643628300215 32 5.656854249492381 33 5.744562646538025 3a 5.830951894845301 35 5.916079783099616 36 6.0 37 6.082762530298215 38 6.164414002968976 39 6.244997998398398 40 6. 32455532033675¢ 41. 6.4031242374328485 42 6.48074069840786 43 6.557438524302 44 6.6332495807108 45 6.708203932499368 46 6.782329983125268 47 6.855654600401044 48 6.928203230275508 49 7.0 Using Python code construct the following matrices. 41, An identity matrix of order 1 x 10. #2. Zero matrix of order 7 x 3. #3. Ones matrix of order 5 x 4 import numpy as np np-identity(10) print (i) -zeros([7,3]) print (z) -ones([5,4]) print (0)[[1. @. @. @. @, 8. @. 0 @. 2 [@. 1. 8. 0, @ @. @. 0 8. @ [@. 0. 1. 0, @, @, @. 0. 0. & [0 0. 6. 1. 0, 6. 0. 2. @ 8 [@. 0. 8. @. 1, @. @. 0. 8 @ [@. 0. 8. @. @ 1, @. 0. 8. @ [@. 0. 8. @. @ @. 1. 0. 0. @ [0. 0. 6. 0. 0. 6. 0. 1. 0. 8 [@. 0. 6. 0. 0.6.0. 0. 1. 0. [@. 0. 0. 8. 0. @ @ @ @ 1.]] [8. 8. @, [e. 0. @ [e. 0. @ [e. &. 0 [e. 0. @ [e. @. 0. [a. 0. 6 (fa. 1.1. (1.1.2 (1a (1.1.2 (1.2.4, # Using Linsolve conmand in python, solve the following system of Linear equations fx - 2y 432-7 fax tyez=4 #-3x 4 2y - 22 = -10 from synpy import * from synpy.abc import x,y,z AeMatrix(((1,-2,3,7],[2,1,1,4],[-3,2,-2,-10]]) solve_linear_systen_LU(A, [x,y,2]) {x: 2, yt -1, 2: 1} turite Python program to estimate a root of an equation f(x) = 3x*2 + 4x-10 using ‘Newton-Raphson method correct up to four decimal places. import math ‘function defination def F(x): return 3*x**244%%-10 # Defining derivative of function def g(x): return 6*x+4 def newtonRaphson(x0,e,N): print("\n\n*** NEWTON RAPHSON METHOD IMPLEMENTATION ***") step = 1 flag = 1 condition = True while condition: if @(x0) @.print("Divide by zero error!) break x1 = x0 = #(x0)/e(x0) print (*Iteration-Xd, x1 = X.6¢ and f(x1) = xe.6f* % (step, x1, #(x1))) x0 = xd step = step +1 if step > N: flag = @ break condition = abs(f(x1)) > e if flage=1: print(*\nRequired root is: %6F '%x1) else: print(*\nNot Convergent. ") # Input Section x@ = float(input('Enter how many correct decimal places ')) @ = float (input( ‘Tolerable Error: ")) N= int(input("Maximum Step: ')) # Starting Newton Raphson Method newtonRaphson(x,e,N) *#* NEWTON RAPHSON METHOD IMPLEMENTATION *** Iteration-1, x1 = 1.637500 and #(x1) = 4.594219 Iteration-2, x1 = 1.35188 and #(x1) = 0.331295 Iteration-3, x1 = 1.277186 and (x1) = 6.002352 Iteration-4, x1 = 1.276984 and #(x1) = @.000000 Required root is: 1.276984 ‘urite Python program to obtained the approximate real root of f(x)= x*3 - 4x - 9 fusing Regula-falsi method. # Defining Function def F(x): return x**3-x*2-2 # Implementing False Position Method def falsePosition(x@,x1,e): step = 2 print(*\n\n*#* FALSE POSITION METHOD IMPLEMENTATION ***") condition = True while condition X2 = xO = (x1-nO) * F(x0)/( F(x1) - F(x@) ) print(‘Iteration-%d, x2 = 20.6f and #(x2) = %0.6F' X (step, x2, #(x2))) Af F(x@) * G2) < 0: x= x2 else:x0 = x2 step = step +1 condition = abs(f(x2)) > e print(*\nRequired root is: %@.8f' % x2) # Input Section x® = float (input(‘Enter xe ')) x1 = float (input(‘Enter x1 ')) e = float(input( ‘Tolerable Error: *)) # Checking Correctness of initial guess values and false positioning Af F(x) * #(x2) > 0.0: print (‘Given guess values do not bracket the root.") print (‘Try Again with different guess values.') else: falsePosition(x®,x1,e) #** FALSE POSITION METHOD IMPLEMENTATION *** Iteration-1, x2 = 1.600000 and (x2) = -1.104000 Iteration-2, x2 = 1.742268 and (x2) = -0.195885 Iteration-3, x2 = 1.765259 and f(x2) =
[email protected]
Iteration-4, x2 = 1.768697 and (x2) = -0.004400 Iteration-5, x2 = 1.769205 and f(x2) = -0.000649 Iteration-6, x2 = 1.769279 and (x2) = -0.000096 Iteration-7, x2 = 1.769290 and (x2) = -0.000014 Iteration-8, x2 = 1.769292 and F(x2) = -.000002 Required root is: 1.76929207
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 (6129)
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
Brené 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 (933)
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 Toibin
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)
Yes Please
From Everand
Yes Please
Amy Poehler
4/5 (1987)
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)
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)
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)
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
Bob Woodward
3.5/5 (830)
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 (2544)
The Light Between Oceans: A Novel
From Everand
The Light Between Oceans: A Novel
M L Stedman
4.5/5 (790)
Java Practical Slips Solution
PDF
No ratings yet
Java Practical Slips Solution
3 pages
REAL TIME FACE ATTENDACE SYSTEM Installation Guide
PDF
No ratings yet
REAL TIME FACE ATTENDACE SYSTEM Installation Guide
14 pages
C-1 Data Structures and Algorithms-I
PDF
No ratings yet
C-1 Data Structures and Algorithms-I
65 pages
Chapter 4
PDF
No ratings yet
Chapter 4
120 pages
Java Slip
PDF
No ratings yet
Java Slip
3 pages
TYBCS Java Slips Solution 2022
PDF
No ratings yet
TYBCS Java Slips Solution 2022
82 pages
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
Yes Please
From Everand
Yes Please
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
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
Rise of ISIS: A Threat We Can't Ignore
From Everand
Rise of ISIS: A Threat We Can't Ignore
Fear: Trump in the White House
From Everand
Fear: Trump in the White House
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
Java Practical Slips Solution
PDF
Java Practical Slips Solution
REAL TIME FACE ATTENDACE SYSTEM Installation Guide
PDF
REAL TIME FACE ATTENDACE SYSTEM Installation Guide
C-1 Data Structures and Algorithms-I
PDF
C-1 Data Structures and Algorithms-I
Chapter 4
PDF
Chapter 4
Java Slip
PDF
Java Slip
TYBCS Java Slips Solution 2022
PDF
TYBCS Java Slips Solution 2022
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