0 Up votes0 Down votes

9 views3 pagesA breve description of Python and computing. Avanzada y metodologías para programar:
1 weasdmskfk sld s
2
3 como seguir instrucciones en programación y mejorar..

Jun 14, 2016

© © All Rights Reserved

TXT, PDF, TXT or read online from Scribd

A breve description of Python and computing. Avanzada y metodologías para programar:
1 weasdmskfk sld s
2
3 como seguir instrucciones en programación y mejorar..

© All Rights Reserved

9 views

A breve description of Python and computing. Avanzada y metodologías para programar:
1 weasdmskfk sld s
2
3 como seguir instrucciones en programación y mejorar..

© All Rights Reserved

- Steve Jobs
- Wheel of Time
- NIV, Holy Bible, eBook
- NIV, Holy Bible, eBook, Red Letter Edition
- Cryptonomicon
- The Woman Who Smashed Codes: A True Story of Love, Spies, and the Unlikely Heroine who Outwitted America's Enemies
- Contagious: Why Things Catch On
- Crossing the Chasm: Marketing and Selling Technology Project
- Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are
- Zero to One: Notes on Start-ups, or How to Build the Future
- Console Wars: Sega, Nintendo, and the Battle that Defined a Generation
- Dust: Scarpetta (Book 21)
- Hit Refresh: The Quest to Rediscover Microsoft's Soul and Imagine a Better Future for Everyone
- The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution
- Crushing It!: How Great Entrepreneurs Build Their Business and Influence—and How You Can, Too
- Make Time: How to Focus on What Matters Every Day
- Algorithms to Live By: The Computer Science of Human Decisions
- Wild Cards

You are on page 1of 3

problem solving.

We want to understand, what does it mean to think

computationally?

That leads to the philosophical question, so

what's computation?

And like a good philosophical question, that leads to

another, deeper philosophical question.

To answer that question of what's computation, let's

start by asking the question, what is knowledge?

And, as we're going to see, we can divide

knowledge up into 2 parts.

There's declarative knowledge, which we can think of the

statements of fact.

And there's imperative

knowledge, or how to's methods.

Statements of facts give us true, but, as we'll see, they

don't necessarily help us think about how to find new

information.

Imperative knowledge, how to methods or recipes, give us

ways of finding new information, and that's going

to be really valuable to us.

Now, to look at this, let's look at an example.

So, what do we mean by declarative knowledge?

Well, here's a piece of declarative knowledge.

That first statement says, the square root of a number x is a

number y such that y * y = x .

You know that's true from high school algebra.

It's a statement of truth.

It tells us something about how to decide whether a

particular number is a square root or not, but can we use

this to actually find a square root?

And the answer is no.

If we have a number x equal to 25 and we're trying to find

the square root of that, and somebody gives us a guess y =

5, we can use this statement to test to see if 5 * 5 = 25 ,

which it does.

But it doesn't tell us how to find the guess.

So declarative knowledge, which is what much of

knowledge is based on, isn't what we need.

We want a different kind of knowledge, and for that,

fortunately, we have imperative knowledge.

As we said, imperative knowledge is how to kinds of

knowledge, or methods or recipes for finding something,

and here's a recipe for deducing square root.

It's actually attributed to Heron of Alexandria, although

there's some debate as to whether he was the original

creator of this algorithm, but it dates from the first

century AD.

And you can see the description here.

Description says if I want to find the square root of some

number x, I'm going to start with a guess.

I'll call it g.

I'm going to take g and multiply it by itself and look

if that result is close enough to x.

If it is, I'm going to stop, and say that g is the answer.

Otherwise, I'm going to make a new guess by averaging g and

x/g , and using this new guess, which I will call g

again, I'm going to repeat the process until we get something

that's close enough.

basic forms.

Right here there's a test.

It's going to let us know when we're done,

when we're close enough.

If that test isn't satisfied, then there's some simple

calculations, like here, that tells us what to do.

And then, finally, there's a flow of control, or a loop,

that tells us how to keep executing the same sequence of

operations until we get, in fact, to a

place where we're done.

This is something that tells us how to find a square root.

This is imperative knowledge and this is what we want.

OK, let's try it out.

Here's a little description of that.

Let's see what happens if we were actually to do it.

So I'm going to do a simple little simulation.

I want to find the square root of 25.

And, yeah, I know the answer is 5, but let's think about

what might happen here.

I'm going to start with a guess and I'm just going to

initially guess 3.

Heron of Alexandria's algorithm says

multiply 3 by itself.

That, of course, gives me 9.

Is 9 close enough to 25?

I don't think so, so let's get x/g , which is about 8.33.

And now, let's take the average of x/g and g.

So we add g and x/g , take the average of

that, and we get 5.67.

And then our little recipe says take

that and do it again.

So this now becomes my new guess, 5.67.

I multiply those together.

I happen to know that comes out to be about 32.5.

I've gotten closer to 25, but it ain't there yet, so that's

not close enough.

Again, let's take x divided by this g which turns out to be

about 4.41, and then I take g and x/g and I average them,

and I get 5.04.

And my algorithm says, my recipe says, take

this and do it again.

5.04 multiplied by itself is about 25.4, and I'm going to

say, you know what, that's close enough, so my little

recipe says there's the answer.

Not perfect, but close enough.

So, Heron had it right.

This looks like a pretty good algorithm.

This is a way of describing a method for doing something,

and that idea, that notion of a recipe, is something we're

going to use a lot.

So we can think of algorithms as being recipes, sequences of

mechanical steps for doing something.

We put that analogy to a little bit more use, we can

see that recipes have much of the same form, real recipes.

Imagine I want to make some custard.

Here's my recipe.

I'm going to take all the ingredients of the custard,

that mixture, put it into a pot over some heat, and I'm

going to stir it.

the custard, pull it out, and run my finger across the back

of the spoon.

If the spoon is clear, then I'm done and I'm going to

remove the custard from the heat and let it cool.

If not, I'm going to repeat.

And notice what we have here.

Again, we've got a test, right there.

And we've got a way of, in fact,

changing the flow of control.

So, normally, the flow runs this way, but based on that

test, we have a way of going back up and

continuing the path.

And this pattern is something we're going to repeat a lot.

So, you want to capture recipes and we need to figure

out how to get the computer to do that for us, which is what

we're going to talk about next.

- Definition of Group DiscussionUploaded bymaramreddyleela
- 07Uploaded bybrendannn
- 2.ModuloUploaded bySmith
- Algorithmic ArchitectureUploaded byasnsashank
- final-Algoritms.pdfUploaded byJudy
- P 2Uploaded byagoyal5145
- Best Book for Each SubjectUploaded byNitin Nilesh
- AlgorithmUploaded bypriya
- Lab 1Uploaded bySara Farah
- C++_chap2_-probsolvingUploaded byfiq
- answers and hintsUploaded byapi-280478588
- Hakuna ResearchUploaded byharhah
- Real-time Multiple Object Tagging Implemented on the DE2BotUploaded bySarthak Batra
- Design of Self-Learning System for Diagnosing Health Parameters using ANFISUploaded byAnonymous kw8Yrp0R5r
- MathsUploaded byDevika Mathur
- yanez2Uploaded byEvelyn Hexe
- 01 - INTRO ALGORITHM.pdfUploaded byerzalya
- Associate AlgorithmUploaded bySaishankar Sanaboina
- chap14[1]Uploaded byNirupam Choudhury
- How to Prepare for Top MNCsUploaded byKumarPintu
- The Distance Geometry of Music _ FullUploaded byKostas Karagiannis
- Noticing NoonanUploaded bylunalorenz
- mm-17Uploaded bySomasekhar Chowdary Kakarala
- An Introduction to ComputingUploaded bymjanus13
- Document 2Uploaded byCharles Quides
- beyond 1Uploaded byapi-424569697
- Greedy heuristics for distributed job shop problemsUploaded byjsebastianpmoya
- Customer Interaction by Lew LiptonUploaded bynaravichandran3662
- g9 blues poster aUploaded byapi-249899429
- Mobile Projected Trajectory AlgorithmUploaded byBhaskar Rao P

- Chathead Basics - Floating Overlay ExampleUploaded byAnon
- Machine Learning for BeginnersUploaded bykhaaba
- Acronis User guideUploaded bydibpal
- Maintenance OrganisationUploaded byGuadagustin
- Mini Project 1Uploaded byNurulAnisAhmad
- Analysis Plant Layout Design for Effective Production - IMECS2011_pp1174-1176Uploaded byHLTM
- InstallUploaded byEmerson Misael Garay
- Concepts & Examples ScreenOS Reference Guide.pdfUploaded byArmand Basy
- Understanding Fourth Generation WarUploaded byfahmynast
- ArcSight Supported ProductsUploaded byDragos Lungu
- BCA_Sem_IIIUploaded bybagano1
- TUTORIAL Surface Modeling in Pro E WildfireUploaded byviolin09
- Index-based Join in Mapreduce Using Hadoop MapfilesUploaded byGlobal Research and Development Services
- Georgianna Kemp Ancestors - 10 Generations - September 2012Uploaded byRandy Seaver
- TRB PG 2019Uploaded bybalajidharani1978
- CompleteGreenItemFile (1)Uploaded byExecutive Computer Products
- Microsoft Dynamics Ax SecurityUploaded byFaisal Fareed
- Computer ScienceUploaded byHarron Remigio Adjok
- Brand StoriesUploaded bypand76
- IDC Case Study-Balboa Park .pdfUploaded byjcy1978
- Hydronic Balancing - CALEFFIUploaded byPref1811
- Idle Mode MobilityUploaded byAnonymous 54XsHCufW4
- Lab Assignment 2 Ms Excel 2 InstructionsUploaded bysangeet711
- Bajaj Tech Wall Mounted BAT PraposleUploaded byChristopher Nguyen
- Arabic SyntaxUploaded byMariana Mania
- 65 ijecsUploaded bydgm st
- 01416a.pdfUploaded byVNK90
- Opciones TL MR3020Uploaded byMiguel Angel Gil
- Mathematical Modelling with Fuzzy Sets of Sustainable Tourism DevelopmentUploaded byAmanda Car
- Electronics Lab Manual 2Uploaded byDinesh Madabattula

## Much more than documents.

Discover everything Scribd has to offer, including books and audiobooks from major publishers.

Cancel anytime.