csci 246 – class 2mdale/courses/csci246/slides/csci 246 - cla… · csci 246 –class 7 proofs...
TRANSCRIPT
![Page 1: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/1.jpg)
CSCI 246 – Class 7PROOFS
Plan for today:
- Quiz
- Normal review of video lesson (Euclidean Algo)
- Quiz question over video
- Review
- Homework
- Python IDE Demo
- Break – Download preferred IDE
- Python
![Page 2: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/2.jpg)
Quiz Questions
Lecture 13:
Remember that Euclidean Algorithm is:
Function gcd(a,b)
If(a<b) return gcd (b,a)
If (b=0) return a
Else return gcd(b, a mod b)
Step through the algorithm gcd of gcd(57, 9):
![Page 3: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/3.jpg)
Notes
Have a good weekend
![Page 4: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/4.jpg)
Lesson 13
Lemma:
Let a>b
By the Quotient – Remainder Theoerm: a=q*b+r
=> r = a mod b
Then GCD (a,b) = GCD(b,r)
![Page 5: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/5.jpg)
Lesson 13
Lemma:
Let a>b
By the Quotient – Remainder Theoerm: a=q*b+r
=> r = a mod b
Then GCD (a,b) = GCD(b,r)
![Page 6: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/6.jpg)
Lesson 13
Proof:
1) let d|a and d|b
![Page 7: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/7.jpg)
Lesson 13
Proof:
1) let d|a and d|b
a=u*d b=v*d
![Page 8: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/8.jpg)
Lesson 13
Proof:
1) let d|a and d|b
a=u*d b=v*d
r = a-q*b = (ud)-q*(v*d) =(u-qv)d
![Page 9: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/9.jpg)
Lesson 13
Proof:
1) let d|a and d|b
a=u*d b=v*d
r = a-q*b = (ud)-q*(v*d) =(u-qv)d
=> d|r
![Page 10: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/10.jpg)
Lesson 13
Euclid or Euclidean's Algorithm
Function gcd(a,b)
If (a<b) return gcd(b,a)
If (b=0) return a
Else return gcd(b, a mod b)
![Page 11: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/11.jpg)
Homework (Group)
Walk through Euclidean's Algorithm for the following:
1. gcd(24, 60)
2. gcd(24, 105)
3. gcd(60, 7)
![Page 12: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/12.jpg)
Homework (Individual)
Walk through Euclidean's Algorithm for the following:
1. gcd(4, 14)
2. gcd(14, 4)
3. gcd(14, 89)
![Page 13: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/13.jpg)
Demo
Python IDEs
Visual Studio Express with Python Plug-in
Pycharm
![Page 14: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/14.jpg)
Break
Python IDEs
Visual Studio Express with Python Plug-in
https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx
https://pytools.codeplex.com/
Pycharm
https://www.jetbrains.com/pycharm/
![Page 15: CSCI 246 – Class 2mdale/courses/CSCI246/slides/CSCI 246 - Cla… · CSCI 246 –Class 7 PROOFS Plan for today:-Quiz -Normal review of video lesson (Euclidean Algo)-Quiz question](https://reader034.vdocument.in/reader034/viewer/2022042212/5eb4751832869a7089277203/html5/thumbnails/15.jpg)
Awesome resources
First Learning
Learn Python the Hard way: http://learnpythonthehardway.org/book/
Check IO Game: http://www.checkio.org/
References:
Hitchhiker’s Guide to Python: http://docs.python-guide.org/en/latest/
Python.org: https://docs.python.org/3/