Placeholder Image

字幕列表 影片播放

  • >> [MUSIC PLAYING]

    >> [音樂播放]

  • >> [MUSIC PLAYING]

    >> [音樂播放]

  • DAVID MALAN: All right.

    DAVID馬蘭:好的。

  • This is CS50.

    這是CS50。

  • [MUSIC PLAYING Tritonal, Cash Cash, "Untouchable"]

    [音樂播放Tritonal,現金現金,  “賤民”]

  • [MUSIC PLAYING]

    [音樂播放]

  • SPEAKER 1: I'm going to France, and you're going, too.

    揚聲器1:我要去 法國和你要去了。

  • [MUSIC PLAYING]

    [音樂播放]

  • DAVID MALAN: This is CS50, Harvard University's introduction

    DAVID馬蘭:這是CS50, 哈佛大學的介紹

  • to the intellectual enterprises of computer science

    以智力 計算機科學的企業

  • and the arts of program-- and for the first time in history,

    和program--的藝術 對於在歷史上第一次,

  • Yale University's as well.

    耶魯大學也是如此。

  • Indeed, whether you're here in Cambridge or in New Haven or Miami or St. Louis

    事實上,無論你在這裡在劍橋 或在紐黑文和邁阿密或聖路易斯

  • or Amsterdam or anywhere around the world

    或阿姆斯特丹或任何地方 世界各地的

  • taking CS50, computer science E50, CS50X, CS50 AP,

    服用CS50,計算機 科學E50,CS50X,CS50 AP,

  • we are all one and the same.

    大家都是同一個。

  • Welcome to CS50.

    歡迎CS50。

  • >> What we have--

    >> 我們have--

  • >> [APPLAUSE]

    >> [掌聲]

  • >> [LAUGHS]

    >> (笑)

  • >> [APPLAUSE]

    >> [掌聲]

  • >> So I made a mistake myself some time ago when I started off college.

    >> 所以,我犯了一個錯誤我自己的一些 很久以前,當我開始上大學。

  • And I got to college, and I decided to frankly, stick within my comfort zone.

    而我上大學,我決定 坦率地說,堅持在自己的安樂窩。

  • I ended up declaring a concentration, or a major, of government.

    最後我聲明濃度, 或重大的政府。

  • Ant that was mostly a function of me being pretty familiar with government

    螞蟻主要是我的函數 是非常熟悉政府

  • or at least history or I really liked constitutional law in high school.

    或者至少是歷史還是我真的很喜歡 憲法在高中。

  • And so when I got here, I kind of gravitated toward things

    因此,當我來到這裡,我種 的趨向了往東西

  • with which I was already familiar.

    與我已經熟悉了。

  • Right?

    對嗎?

  • God forbid I do poorly in the class.

    上帝保佑我在課堂上做的很差。

  • I certainly wanted to stay within my comfort zone,

    我當然想留 在我的安樂窩,

  • and it wasn't until sophomore year that I finally

    而且直到 大二那年,我終於

  • got up the nerve to step foot in a classroom called CS50.

    鼓起勇氣步驟腳 在一個名為CS50教室。

  • And at that point, did I finally realize that, my God, homework could actually

    在這一點上,我才終於明白 是,我的上帝,家庭作業居然可以

  • be fun.

    很有趣。

  • >> Indeed, I was one of those kids that on Friday evenings when

    >> 事實上,我是那種一個孩子 上週五晚上,當

  • the P-SETS would be released, I would go back to my room and dive

    在P-SETS將被釋放,我 會回到我的房間,潛水

  • into the night's P-SETS.

    到晚上的P-集。

  • And for me, that was a sign that this was a field for me.

    而對於我來說,這是個好兆頭 這是一個場對我來說。

  • But what was more important was the fact that I did get up this nerve

    但更重要的是 事實上,我的確得到了這根神經

  • to explore waters unfamiliar to me and get beyond my own comfort zone

    探索對我不熟悉的水域 並獲得超出了我自己的安樂窩

  • and frankly, I only was able to do that sophomore year by taking this class

    坦率地說,我只能夠做到這一點 大二的時候採取這一類

  • pass/fail.

    通過/失敗。

  • >> Indeed, it was the very last day that I finally switched over and finally

    >> 事實上,這是最後一天, 我終於切換,最後

  • declared CS as my concentration, putting gov at that point behind me.

    聲明CS為我的注意力, 把政府網站在我身後這一點。

  • And so we're not setting out in this course to turn all of you

    所以,我們不設置在 這當然把所有你

  • into CS majors or concentrators, but rather to give you an opportunity

    進入計算機專業或集中,但 而是為了給你一個機會

  • to hopefully go beyond the world with which you're currently familiar

    有希望超越世界 與您目前熟悉

  • and bring back from this world skills and knowledge and savvy

    而從這個世界帶回 技能和知識和悟性

  • that you can apply to your own world, whether that's

    您可以應用到您的 自己的世界,不管是

  • in the humanities, social sciences, natural sciences, or beyond.

    在人文科學,社會科學, 自然科學,或超越。

  • >> Indeed, if you're feeling a little intrepid

    >> 事實上,如果你 感覺有點勇敢

  • about being in this room let alone in this class,

    關於這個房間是 更何況在這個班,

  • realize that if history is any indication, 72% of you

    認識到,如果歷史 任何跡象表明,你72%

  • have never taken a CS course before.

    以前從來沒有採取CS課程。

  • So it is by all means not the case that the student sitting to the left

    因此,它是通過各種手段並非如此 該學生坐在左邊

  • or to the right or in front or behind you knows far more about CS

    或向右或前面或 你身後知道遠更多關於CS

  • or programming in particular than you.

    或在特定的比你的編程。

  • That's not in fact the case.

    這其實不是這樣的。

  • And indeed, much of the support structure

    事實上很多, 支撐結構

  • that we've set up in this course over the past many years

    我們已經在此設立 當然,在過去的許多年

  • has been for exactly that reason-- to provide an on ramp that still exits

    一直正是reason--到 斜坡上仍然退出提供

  • just as rigorously and just as high as ever--

    正如嚴格和 一樣高ever--

  • but the slope of which allow students less comfortable and more comfortable

    但它的坡度讓學生 那麼舒服,更舒適

  • alike to succeed irrespective of his or her prior background.

    一樣的成功,不論 他或她事先背景。

  • >> Indeed, what ultimately matters in this class is not

    >> 的確,最終 問題在這個類是不

  • so much where you end up relative to your classmates

    這麼多,你最終會 相對於你的同學

  • but where you in week 12 end up relative to yourself

    但如果你十二週 結束了相對於自己

  • in week zero, which is where we are here today.

    在零週,這是 我們今天在這裡。

  • >> Indeed and this may very well and probably does look like Greek

    >> 事實上,這可能非常好 而且很可能看起來像希臘

  • to many of you.

    許多你。

  • But rest assured, that this and so much more

    不過放心,這 這和這麼多

  • is going to be completely within your grasp in just a little bit of time.

    將是完全在你的 把握時間只是一點點。

  • >> But today, we focus on some of the higher level ideas

    >> 但是今天,我們關注一些 的較高級別的想法

  • to give you a taste of CS50 and computer science

    給你的味道 CS50和計算機科學

  • in a sense of what you're signing up for.

    在某種意義上是什麼 你報名參加。

  • And indeed, computer science might be distilled more

    事實上,計算機科學 可能更蒸餾

  • simply as computational thinking-- thinking like a computer, if you will.

    簡單地計算thinking-- 思就像一台電腦,如果你願意。

  • And there's so many different things ingredients that go into that,

    而且有這麼多不同的事情 成分進入的,

  • but let's propose just three for today.

    但是讓我們提出只有三個為今天。

  • If the goal of the class ultimately is not to teach you programming,

    如果類的目標,最終 不是教你編程,

  • is not to teach you C or PHP or SQL or any number of the words

    是不是要教你C或PHP或 SQL或任何數目的字

  • and acronyms in the course's description,

    並在縮略語 當然描述,

  • but rather to teach you to solve problems more effectively

    而是教你 更有效地解決問題

  • and to think more methodically and more algorithmically, so to speak.

    並認為更有條理和 更多的算法,可以這麼說。

  • Let's see what exactly this means.

    讓我們來看看究竟是什麼意思。

  • >> So I would propose that thinking computationally boils down

    >> 所以,我建議思考 計算歸結

  • to solving problems.

    以解決問題。

  • What do you need to solve a problem?

    你有什麼需要解決的一個問題?

  • You need to input-- like the input to the problem--

    您需要input--像 輸入到problem--

  • you need an output, which is hopefully the solution,

    需要的輸出,這 是有希望的解決方案,

  • and then you need a process by which to solve that problem, which

    然後你需要一個過程, 要解決這個問題,這

  • we'll call an algorithm-- a set of instructions for solving some problem.

    我們會打電話給一個算法 - 一組 說明解決一些問題。

  • >> But first, let's focus on the first and the last of these inputs and outputs.

    >> 但首先,讓我們關注的第一和 最後這些輸入和輸出。

  • Computers after all, apparently only understands zeros and ones.

    計算機畢竟,顯然 只有理解零和一。

  • But how can that possibly be?

    但如何才能使這可能是?

  • Even if you're not familiar at all with what's underneath the hood,

    即使你不熟悉的一切 什麼是引擎蓋下,

  • you probably at least heard that computers understand binary--

    你可能至少聽說 計算機能夠理解binary--

  • just zeros and ones-- but how can you possibly do anything interesting?

    只是零和ones--卻怎麼也 你可能做什麼有趣的事?

  • >> Well, one of the themes of the class is going

    >> 好了,主題之一 類的會

  • to be this layering-- where today, we'll take a quick glance at the lowest level

    是這個layering--今天在這裡,我們將 我們快速瀏覽一下的最低水平。

  • details, but with each passing day, where we layer

    細節,但與每 過一天,我們在那裡層

  • or abstract on top of those details to actually solve higher level

    或者在這些細節上面抽象 要真正解決更高層次

  • problems of interest to us.

    我們感興趣的問題。

  • >> So here is what we might call binary-- with just an alphabet of 0 and 1.

    >> 因此,這裡就是我們可以稱之為binary-- 用0和1只是一個字母。

  • But we humans are mostly familiar with decimal.

    但是,我們人類大多 熟悉小數。

  • Dec meaning 10.

    十二月意義10。

  • Bi meaning two.

    畢意兩種。

  • And so in the decimal system, we have 10 digits

    並因此在小數 系統,我們有10位

  • at our disposal-- of course, zero through nine.

    在我們的disposal-- 當然,0到9。

  • So if you look at a number like this, most of you

    所以,如果你看一個數字 像這樣的,你最多

  • intuitively just grasp that is 123.

    直觀地只是把握是123。

  • There's nothing really hard about that.

    沒有什麼真的很難有關。

  • But why is it 123?

    但為什麼123?

  • Well, if you think back to grade school-- or at least

    好吧,如果你想回 等級school--或至少

  • the way I learned this kind of world-- you

    我了解到這個問題的方法 那種天下 - 你

  • might recall that we treated these things in columns, or places.

    可能還記得,我們​​處理這些 事情列或場所。

  • >> So we have the ones place on the right.

    >> 因此,我們有在右側的那些地方。

  • The tens place in the middle.

    十位放置在中間。

  • The hundreds place on the left.

    數百放置在左側。

  • And then how do we get from this pattern symbols--

    然後我們怎麼 從這種模式symbols--

  • 1 2 3-- to this higher level idea that we know as 123?

    1 2 3--至更高水平 想法,我們所知道的123?

  • Well, it's just some simple arithmetic.

    好吧,這只是一些簡單的算術。

  • Right?

    對嗎?

  • >> The one there is essentially means give us 100 times 1 plus 10 times

    >> 一個有實質上是指 給我們100倍1加10倍

  • 2 plus 1 times 3.

    2加1次3。

  • And of course if we do out the math there, it's 100 plus 20

    當然,如果我們做出來的 數學那裡,它是100加20

  • plus 3-- otherwise known as 123.

    加3--否則稱為123。

  • >> So if you're on the same page as that right

    >> 所以,如果你在 同一個頁面的右側

  • now and are comfortable with the so-called decimal system as a human,

    現在是舒服的 所謂十進制系統作為一個人,

  • it's actually well within your scope of comfort

    它實際上完全在 您的舒適範圍

  • to consider now the binary system.

    現在要考慮的雙星系統。

  • Take a wild guess-- this represents, in the world of computers

    以野生guess--這代表, 在計算機的世界

  • in binary-- what number?

    在binary--什麼號碼?

  • Zero.

    零。

  • >> But why is that?

    >> 但是,這是為什麼?

  • Well, it turns out that the columns or places here-- they're not powers of 10.

    嗯,事實證明,該列或 這裡 - 他們不是10的冪的地方。

  • 1, 10, 100, 1,000, and so forth.

    1,10,100,1000,等等。

  • They're instead, quite simply, powers of 2.

    他們相反,相當 簡單地說,2的冪。

  • So, 1, 2, 4, 8, 16, 32, and so on.

    因此,1,2,4,8,16,32,等等。

  • And so now we of course get to 0 here simply because we have 4 times

    所以,現在我們當然得到0 在這裡,只是因為我們有4倍

  • 0 plus 2 times 0 plus 1 times 0, which of course gives us 0.

    0加2次0加1次 0,這當然給了我們0。

  • >> But how do I go about representing the number 1?

    >> 但我怎麼去 表示數字1?

  • What's the pattern of zeros and ones to represent

    什麼是模式 零和一表示

  • the number we humans know as 1?

    數我們人類所知道的1?

  • 001.

    001。

  • And 2?

    和2?

  • 010.

    010。

  • >> And now the pattern starts to repeats.

    >> 而現在的模式開始重複。

  • Now it's 011.

    現在是011。

  • And again, 0 fours, one 2, one 1.

    再次,0四肢一2一1。

  • So 2 plus 1.

    因此,2加1。

  • That's 3.

    這是3。

  • >> And now to represent 4, we don't just change that 0 to a 1.

    >> 現在來表示4,我們 不只是改變0到1。

  • You sort of have to carry, so to speak, and the numbers

    那種你必須隨身攜帶, 可以這麼說,而且數量

  • start flipping around just like in the decimal world.

    開始只是翻轉各地 像在十進制世界。

  • >> So this is 4.

    >> 因此,這是4。

  • This is 5.

    這是5。

  • This is 6.

    這是6。

  • This is 7.

    這是7。

  • And so we've counted as high as 7.

    所以,我們計算高達7。

  • >> Now all we just need is more a bits-- more zero's and one's.

    >> 現在我們只是需要更多的是 bits--更多的零的和一個人的。

  • And indeed "bits", if you've heard this term-- binary digit.

    事實上“位”,如果你 聽到這個term--二進制數字。

  • Bit is where that comes from.

    位就是來自。

  • And so if we want to represent bigger numbers, we need more bits.

    所以,如果我們要代表 更大的數字,我們需要更多的位。

  • But let's move away from slides now to something a little more real.

    但是,讓我們遠離幻燈片現在 以一些更實際。

  • Suppose that we want to actually represent this thing.

    假設我們要 實際上代表這件事情。

  • >> Well let's take a look now at a little demonstration.

    >> 那麼讓我們來看看現在 在一個小演示。

  • So this is a web based application that one of CS50's own, Michael G,

    因此,這是一個基於Web的應用程序 這對CS50自己,邁克爾·摹之一,

  • put together this summer to help us elucidate exactly this idea.

    放在一起在今年夏天幫助 我們闡明正是這種想法。

  • And would someone like to venture up on stage

    並會有人喜歡 冒險在舞台上

  • in front of all his or her classmates?

    在他或她的所有同學面前?

  • Right there in front.

    正確的,在前面。

  • Come on up.

    上來吧。

  • >> You have to be comfortable on camera and the internet.

    >> 你必須要舒服 在相機和互聯網。

  • Oh, right here.

    呵呵,就在這裡。

  • OK.

    確定。

  • We're OK.

    我們很確定。

  • All right.

    好的。

  • Come on up.

    上來吧。

  • What's your name?

    你叫什麼名字?

  • Emily come on up.

    艾米麗上來吧。

  • So this is Emily.

    因此,這是艾米莉。

  • What year are you?

    哪一年是嗎?

  • >> Freshman.

    >> 大一。

  • >> Emily, nice to meet you.

    >> 艾米麗,很高興見到你。

  • David.

    大衛。

  • >> All right.

    >> 好的。

  • So up on the screen here, we have this touch screen

    因此,在屏幕在這裡, 我們有這樣的觸摸屏

  • which is going to allow us to actually interact with this program,

    這將允許我們 這個程序實際上是互動,

  • and it's just a browser.

    它只是一個瀏覽器。

  • It's Chrome full screened at the moment, but it's

    它的鍍鉻全屏蔽 此刻,但它的

  • been programmed by Michael to respond in a way that allows

    已編程邁克爾 的方式,允許響應

  • us to play around with binary digits.

    我們玩的二進制數字。

  • >> So for instance, here we have not three but eight bits-- zeros and ones.

    >> 因此,例如,我們在這裡有沒有 3條,但8 bits--零和一。

  • Right now, we're looking at the number 0.

    現在,我們 看數字0。

  • And indeed, all eight zeros in decimal means zero.

    事實上,所有八個零 十進制表示零。

  • So that's all that's being hinted at here.

    所以,這一切的 被暗示在這裡。

  • >> So if you wanted to represent the number 8,

    >> 所以,如果你想 表示數字8,

  • what's the pattern of zeros and ones that you want?

    什麼是零的格局 和那些你想要什麼?

  • You can simply tap up or down or the numbers themselves.

    你可以簡單地點擊向上或向下 或數字本身。

  • All right.

    好的。

  • So that of course is 8, as you can see up there.

    使當然是8, 你可以看到在那裡。

  • And if we wanted to do 16, what do we do?

    如果我們想 做16個,我們該怎麼辦?

  • >> Yep, just touch it again.

    >> 是的,只需再次觸摸它。

  • 16.

    16。

  • All right.

    好的。

  • So this is all fine and good, it's still very low level.

    因此,這是一切優秀和良好, 它仍然是非常低的水平。

  • We need a way in the real world for Emily

    我們需要的一個方式 現實世界中的埃米莉

  • of actually representing these things.

    實際上代表這些東西。

  • And so suppose that we turn these zeros and ones, which is very

    所以,假設我們把這些 零和一,這是非常

  • conceptual, into actual light bulbs.

    概念,為實際燈泡。

  • Right?

    對嗎?

  • >> A computer is a physical, mechanical, electrical device.

    >> 計算機是一種物理, 機械,電氣設備。

  • And its input-- at least if you plug it in or charge it--

    和至少如果其input-- 您或負責將其插入它 -

  • is to have battery power and electrons flowing in and out.

    是有電池電量和 電子流進和流出。

  • >> So now, why don't we stop thinking about bits as zeros and ones,

    >> 所以,現在,我們為什麼不停止思考 關於位為0和1

  • but something more physical like light bulbs here.

    但更多的東西物理 就像燈泡在這裡。

  • And if Dan Armendariz could join me for just a moment-- come on up--

    如果丹Armendariz環能加盟 我只是一個moment--來吧up--

  • we're going to queue up an application.

    我們要排隊的應用程序。

  • >> Come on over, Emily.

    >> 你過來吧,艾米麗。

  • Sorry this is the most awkward demo for you ever.

    很抱歉,這是最 尷尬的演示給你直到永遠。

  • Come on over here.

    來吧,在這裡。

  • We're going to queue up with thanks to Dan

    我們要排隊 與感謝Dan

  • Armendariz, another member of our staff, an application known as binary bulb.

    Armendariz環,我們的工作人員的另一名成員, 稱為二進制燈泡的應用程序。

  • >> So what we have here is an iPad application

    >> 所以,我們在這裡 是一個iPad應用程序

  • that has the following user interface on the screen for Emily.

    具有以下用戶 界面屏幕艾米麗上。

  • It's just got the same exact UI essentially that's over there.

    這只是得到了完全相同的用戶界面 基本上是在那邊。

  • And if you now want to represent the number, say 8,

    如果你現在要 表示數字,說8,

  • how would you go about doing this noticing at the right,

    你將如何去這樣做 這注意到在正確的,

  • the light bulbs that we have here?

    燈泡,我們在這裡?

  • Ah-ha.

    啊,哈。

  • Magical.

    妙用。

  • So if we want to now turn this into something a little more challenging,

    因此,如果我們想現在把它變成 東西多一點挑戰性,

  • and let's go ahead and pick a random number like the number 50 here.

    讓我們繼續前進,選擇一個隨機的 像數50此處號碼。

  • Input this.

    輸入這一點。

  • And if you can now be challenged to come up with the number 50,

    如果你現在可以質疑 拿出數50,

  • we'll have a fabulous prize for you.

    我們會為您提供一個神話般的獎金。

  • >> EMILY: OK.

    >> 艾米麗:OK。

  • Oh my God.

    哦,我的上帝。

  • DAVID MALAN: Arithmetic is indeed hard in front

    DAVID馬蘭:算術 的確很難在前面

  • of hundreds of your classmates.

    數百你的同學。

  • But 50 has been the answer here.

    但50曾在這裡得到了答案。

  • >> [APPLAUSE]

    >> [掌聲]