Python Programming for the Puzzled

In this course, we use Python to solve a variety of puzzles. Two of the puzzles involve the game of chess. (Image by Brett Paci at MIT OpenCourseWare.)

By Joe Pickett, OCW Publication Director

Python Programming for the Puzzled

Those Sudoku number grids that look so easy but can be so exasperating—wouldn’t it be great to write a program that can solve every one of them?

Imagine you’re a magician, and your neat trick is to read the minds of the people in the audience. They’ve seen some cards pulled from a deck. You boast that you can read their minds and pick the fifth card, which is amazing, because you’ve already missed the first four! How can you pull this trick off?

The bike rack on your car has gotten loose and needs to be re-secured. All you need is a bolt and a nut that match the size of a hole in a metal tube. Luckily, you’ve got lots of bolts and nuts in a couple of jars on a shelf. Maybe it’s finally time to see which bolts and nuts fit together. But you don’t have all day. You need to get this done quickly. You’re meeting up with friends  . . .

Solving Algorithmic Puzzles with Python

These vexing challenges might seem about as different from each other as can be, but the puzzles they present are all solvable by algorithms and a little Python programming!

That’s right—you can program magic, and mechanics, and Sudoku grids right from your home computer. All you need is a little help from Professor Srini Devadas, now available in his course 6.S095 Programming for the Puzzled.

Taught during the IAP period of January 2018, the course has on its OCW site full video lectures, a prose description of each puzzle challenge, the necessary Python code, and the solution to the puzzle.

Professor Devadas is a master at making programming fun by tying it to real-world conundrums. He’s won an MIT MacVicar Fellowship for being such a great teacher, and in this course he’s at the top of his game.

Professor Srini Devadas begins his explanation of how he “read” the minds of the class in the “You Can Read Minds” puzzle.

There’s a square courtyard you have to tile. It should be an easy job, only the tile you’ve been given isn’t square. It’s L-shaped. And there’s this statue that you’ll have to work around. Don’t fret! Professor Devadas has the magic formula!

How can you place eight queens on a chessboard such that no queen attacks any other? How about if you have a chessboard of any size and a number of queens matching that board’s number of columns or rows? You don’t have to be a chess master to solve this one!

Professor Devadas knows how to foster creative thinking with programming, and the puzzles he unravels will surely lead his students to solve even more mind-bending puzzles in the future.

Thanks to you – OCW for the Win!

Dear Friends of OCW,

We are so grateful to the more than 200 OCW learners who were able to donate yesterday during the MIT Pi Day Giving Challenge.

Because of their support, we were able to reach our goal and earn an additional $4,000!  This support along with the challenge prize will help:

  • Sustain OCW’s unique mission of sharing MIT’s teaching materials openly with the world.
  • Publish updated and new course publications reflecting the entire gamut of instruction and student experience.
  • Increase the impact of OCW’s publications on learning and teaching around the world.
  • Raise awareness of OCW’s unique course offerings and resources.

A special thanks to OCW supporter Richard Soley, for believing in OCW and providing the challenge prize.

Sincerely,
Joe

Joseph Pickett
Publication Director
MIT OpenCourseWare

P.S. If you weren’t able to donate during the Challenge Day, you are in luck! We appreciate and accept donations on our giving site, every day and at any time!

Serving you and millions of learners ✏

“I am a computer enthusiast and I always
wanted to attend an institute of higher
level, but then I found a job with shift
work very hard, which does not allow me
to attend.

In addition, the high costs that I could
not support, having lost my dad at 13 and
having to help with household expenses,
were prohibitive.

So I decided to remain a self learner and
I went in against a big problem: which
sources are reliable and which are not?

Internet is immense and the risk of
getting the wrong information is high …

As I became aware of MIT OPENCOURSEWARE
I was delighted to find an authoritative
source where I could find a lot of
information for free. It’s really a
fantastic idea and I thank all the
teachers who volunteered to share
their knowledge.”

-Alessandro, Independent Learner, Italy

 

Dear Friend of OCW,

It’s a privilege for us at OCW to serve enthusiastic learners like Alessandro and millions of others who look for free and reliable educational resources to support their educational pursuits.

Please consider OCW in your end-of-year giving so that we can continue to openly share MIT materials with a world of people seeking to refresh their knowledge, learn something new, or gain the understanding they need to fulfill their life goals.

Your donation, large or small, will help us to keep publishing and distributing the educational materials that make a difference to learners everywhere.

Why not be part of OCW’s effort to advance learning? If you can, please support OCW today.

Sincerely,

Joe

Joseph Pickett
Publication Director
MIT OpenCourseWare

 

ocwbythenumbers2

Notes from the Overground

Illustration from the lecture notes for module 1, session 4, of 5.07 Biological Chemistry 1, showing how penicillin inhibits cell wall biosynthesis in bacteria by inhibiting the enzyme transpeptidase.

Illustration from the lecture notes for module 1, session 4, of 5.07 Biological Chemistry 1, showing how penicillin inhibits cell wall biosynthesis in bacteria by inhibiting the enzyme transpeptidase.

By Joe Pickett, OCW Publication Director

In the days of high resolution video, lecture notes may not seem like a flashy way to learn, but they represent one of OCW’s most valuable and portable learning resources.  Currently, almost 650 course sites in the OCW collection have complete lecture notes, and many other sites have selected notes. Another 67 courses have full online textbooks.

At their most robust, lecture notes can mimic textbooks, with clearly written prose, crisp mathematical notation, and graphs or illustrations.

A good way to zero in on class notes in a subject that interests you is to visit the Teaching Materials search on the OCW Educator portal. Here you can call up a specific subject area, and find all the courses within it that have lecture notes, complete or selected.

Teaching Materials Search

But see for yourself in this sampler of recently published courses with lecture notes:

This course discusses theoretical concepts and analysis of wave problems in science and engineering. Examples are chosen from elasticity, acoustics, geophysics, hydrodynamics, blood flow, nondestructive evaluation, and other applications.

This course examines the chemical and physical properties of the cell and its building blocks, with special emphasis on the structures of proteins and principles of catalysis.

This course provides students with the basic tools for analyzing experimental data, properly interpreting statistical reports in the literature, and reasoning under uncertain situations. Topics organized around three key theories: Probability, statistical, and the linear model.

This course studies information and contract theory, encompassing decision making under uncertainty, risk sharing, moral hazard, adverse selection, mechanism design, and incomplete contracting.

This course presents a computationally focused introduction to elliptic curves, with applications to number theory and cryptography. It works its way up to some fairly advanced material, including an overview of the proof of Fermat’s Last Theorem.

This is the first semester of a one year graduate course in number theory covering standard topics in algebraic and analytic number theory.

This course is the continuation of 18.785 Number Theory I. It begins with an analysis of the quadratic case of Class Field Theory via Hilbert symbols, in order to give a more hands-on introduction to the ideas of Class Field Theory.

The MicroMasters program in Data, Economics, and Development Policy provides new path to MIT

Online learning initiative provides real-world opportunity for students.

Chuka Ezeoguine is a student from Port Harcourt, Nigeria, who is majoring in computer science. Driven to help the world’s poor, he is developing the knowledge base he needs to create algorithm-based solutions to economic problems.

Camelia Vasilov recently graduated from Leiden University College and interns at the World Startup Factory. Raised in Moldova, her first-hand experience with poverty motivates her to master the analysis and application of empirical research, so she can return home to design and implement sound development policies.

Sangalore Sumit is a computer science engineer in Bangalore, India. He hopes to aid government in the development and implementation of data-driven programs that bridge the gap between public policy and public welfare.

Living and working on separate continents, these people have one thing in common: they all studied together at MIT. MITx, that is.

Studying together around the world, students in the MITx MicroMasters program in Data, Economics, and Development Policy (DEDP) are connected by digital learning technologies and driven by a common cause: to help people in their communities and developing countries overcome challenges facing the world’s poor.

MITx MicroMasters is a new way to pursue a credentialed course of study from MIT. The cost of the DEDP program is based on ability to pay, and classes are open to anyone. According to Benjamin Olken, Professor of Economics, MIT, and Director of the Abdul Latif Jameel Poverty Action Lab (JPAL), “Whether you’re interested in a career in development policy, or interested in pursuing graduate school admissions, this certificate will signal your competence with advanced material.”

Students who successfully complete the five-course curriculum can apply to a newly-established accelerated master’s degree program offered by MIT’s department of economics. Accepted students will earn their degree in one semester while studying at the main campus in Cambridge, Massachusetts.

“There are thousands of social programs all over the world,” says Esther Duflo, Abdul Latif Jameel Professor of Poverty Alleviation and Development Economics, MIT, Co-founder and Co-director of JPAL. “But how do you evaluate their effectiveness? How do you ensure that policies used to tackle these problems are backed by scientific evidence? And how do you determine which methods are most useful in addressing these problems and yielding the best outcomes?”

Staying true to MIT’s commitment to academic rigor, the MicroMasters program in DEDP equips students with the skills and knowledge required to assess the effectiveness of anti-poverty initiatives through data-driven methodologies. It provides a solid foundation in microeconomics, data analysis, probability and statistics, development economics, and program evaluation.

“Our goal is to create a cadre of rigorously trained development economists to engage the problems of developing the world,” says Abhijit Banerjee, Ford Foundation International Professor of Economics, MIT, Co-founder and Co-director of JPAL.

Expand your mind. Expand your future. Learn more about the MicroMasters program and start improving the world today.

Writing for Success and Pleasure

Planning diagram for a short story. (Image courtesy of Simon Scott on Flickr.)

By Joe Pickett, OCW Publication Director

The great majority of courses published on OCW have a communications component to them, in no small part because of MIT’s communications requirement for undergraduates. MIT sees communications as an essential component to any career its graduates might undertake, regardless of their area of concentration. Since 2001 (the year when OCW came to life) MIT has required undergraduates to take four communications-intensive subjects “to ensure that the students’ communication training is distributed over several years of study.” Two subjects must be from the Humanities, Arts, and Social Sciences, and two must be from the student’s major.

Among the many communications-intensive course offerings in the MIT curriculum are courses devoted to writing. Many of these have their home in the Comparative Media Studies/Writing department, which is amply represented on OCW.

The course sites all have assignments designed to ignite the creative spark. Most have ingenious, practical exercises for developing the skills needed to impress and convince readers. You’ll find valuable writing resources with a variety of tips and guidelines about how to write well. And of course there are readings that present admirable models for the genre of writing in question.

Below is a sampler of recently published OCW writing courses:

 

Professional Writing Courses

 

“This course offers analysis and practice of various forms of scientific and technical writing, from memos to journal articles, in addition to strategies for conveying technical information to specialist and non-specialist audiences.”  Designed to deal with special problems of advanced ELS or bilingual students, the course has resources that almost any writer would be wise to take advantage of. Eminently practical, it covers writing for the public; emails and memos; job letters; writing up research; conference papers and posters, and two minute “nano-presentations.”

 

“In our reading and writing we explore the craft of making scientific concepts, and the work of scientists, accessible to the public through news articles and essays. The chief work of the class is students’ writing; assignments include a brief essay and news article, an interview-based or archival essay, and a longer (2,000–2,500 word) researched essay. Students also write a review-essay of a book of their choice from a list provided and make one or more short oral presentations.” Check out the “Resource for Checking Facts and Controversies.”

 

This course helps writers discover and engage with issues that matter to them. Students write narrative essays, investigative essays, and grant proposals. They examine “different rhetorical strategies that aim to increase awareness of social problems, to educate the public about different perspectives on contemporary issues and to persuade readers of the value of particular solutions to social problems.” Resources include “Exercise on research and note-taking,” “Working with Quotes,” “The Use of Outside Sources in Narrative Essays.”

 

Personal (“Creative”) Writing Courses

 

“Writers will craft essays that reflect on their own experience as participants or viewers of a sport that reflect on issues related to sports, and that research and explore a sports-related topic in depth. Revision and workshopping are both an important part of the class’s work.”

 

“This class will focus on the craft of the short story, which we will explore through reading great short stories, writers speaking about writing, writing exercises and conducting workshops on original stories.”

The site has lecture notes on everything from “What is Plot and How Can It Be Constructed?” to “The Way a Professional Writer Works in the World.” Most topics are accompanied with exercises, like “Where to Start,” “Character,” and “Point of View.” There’s even a guide on how to participate in the course’s workshops.

 

“During the first seven weeks . . . we will discuss techniques directly related to the assigned stories . . . The second seven weeks . . . will be devoted to workshops of original student stories. Using the vocabulary of technique, every student will participate in workshops leading to polished, finished fiction.”

 

“This course explores, through reading and writing, what it means to construct a sense of self-and a life narrative-in relation to the larger social world of family and friends, education, media, work, and community.” Most readings have corresponding written assignments. Students also write four main essays, whose assignments are described in detail.

“The very notion of what constitutes race remains a complex and evolving question in cultural terms. In this course we will engage this question head-on, reading and writing about issues involving the construction of race and racial identity as reflected from a number of vantage points and via a rich array of voices and genres.”

The Once and Future City

“A cloudy evening on the bridge between Boston and Cambridge. In 2015, this course focused on the 100th anniversary of MIT’s move across the Charles River, from Boston to Cambridge. (Courtesy of nd-nʎ on Flickr. CC BY-NC-SA.)”

By Joe Pickett, OCW Publication Director

Walk around a neighborhood in your city or town, and you might notice the different styles of buildings, the width of the streets, the kinds of trees or other plants, the open spaces, the way the wind whistles. Taking it all in, you might feel caught up in the moment. Ah!

But maybe you’re just trapped in the present.

Stretching your time frame is a major focus of 11.016J The Once and Future City, just published on OCW as taught by Professor Anne Whiston Spirn in Spring 2015.

Identifying the Pieces

“Cities are the products of the actions of millions of people and countless decisions, public and private,” Professor Spirn notes in one of her three videos that kick off the assignments. “How do all the pieces, styles, and times fit together?”

Early in the class students investigate maps of Boston, discovering how the city has changed over the centuries. “Who has the power to erase roads, to consolidate hundreds of properties?” a second video asks. “Why do some things persist and others disappear?”

A big part of the course is learning how to look, how to find “significant detail.” This process can be awkward for students accustomed to finding a right answer to a given question. The students are “not just taking a text and applying it, or critiquing something that already exists. They are developing visual thinking skills, and they have to make observations using their own eyes and mind. Many are not prepared for this.”

Stepping outside the Classroom Box

Professor Spirn helps them see for themselves by taking them on short field trips, where she asks provocative questions to get students thinking. As she explains in “Leading Productive Field Trips,” one of her Instructor Insights,

“The field trips are designed to give the students an introduction to methods of observation before they have to go out and perform field observations on their own at the sites they choose for their projects. We walk around and I show them how to look at things, how to find significant detail. But what is significant? Some students don’t see anything at all . . . Others see so many things that they can’t make sense out of what is significant and what is trivial. The field trip helps both kinds of students.”

Seeing Patterns Emerge

This form of teaching is very different from how Professor Spirn originally taught the course, back when she imparted knowledge through class lectures. Several years ago she decided to flip her classroom. Now instead of lecturing, she says

“I put together a series of images—mostly maps and photographs . . . Depending on the current assignment, the images emphasize different phenomena. But they always consist of puzzles . . . I’ll project an image on the screen and say, ‘What pattern do you see here?’ Sometimes nobody sees a pattern, so I say, ‘OK, do you see any anomalies? Does anything stick out or seem odd?’”

From the puzzles emerge patterns, and from the patterns, a hypothesis.

 

Opening the Mind’s Eye through Projects

The course site has extensive descriptions of the assignments, in which students select a site to explore, observe the natural processes at play in it, analyze its changes through time, and see what all of this bodes for the future.

Included on the site are examples of student projects from four different iterations of the course, among them papers on Coolidge Corner, The Bullfinch Triangle, and Boston’s West End.

11.016J turns the present into a portal for time travel. If it sounds fantastic, that’s because it is.