Vous êtes sur la page 1sur 4

Homework Assignment 1 MACS 556: Modeling with Symbolic Software Spring 2011 Prof. W.

. Hereman Given: Wednesday, January 19, 2011 Due: Wednesday, February 2, 2011

Introduction to Mathematica 8
Task 1: Reading about Computer Algebra Systems To learn about the history of symbolic computation and early computer algebra systems (CAS), read the article (handed out in class): Computer algebra: lightening the load, by Willy Hereman, Physics World 9(3), pp. 47-52 (1996). Update your knowledge with a search on the Internet for information about CAS. For example, Wikipedia oers some information about the history of computer algebra and a comparison of CAS. Information about CAS can also be found at SymolicNet (http://www.symbolicnet.org). Required hand-in: A couple of paragraphs about your favorite story related to the history of CAS, plus the link to the source and the pdf le (if available). A list of the most interesting websites you visited during your search for information about CAS and their history. Task 2: On-line Help, Tutorial(s), Functionality of Mathematica 8 Start a Mathematica 8 notebook. Click on the Help icon, then on Virtual Book, select the section called Introduction, and then, e.g., the sections on Running Mathematica or Getting Started (if you are a novice). If you have used Mathematica before, you should read sections like Dening Functions, etc. If you are an experienced Mathematica user, skip the Introduction and learn about more advanced topics under Core Language or Mathematics and Algorithms. Experts could explore the sections on Expressions or Patterns (both under Core Language). Once you open sections in the book you are in a Notebook environment. So, you can execute the commands (with Shift-Enter!), and more importantly, you can modify the sample commands and do more advanced experiments. The purpose of this task is to practice Mathematica commands on the computer. Pay attention to the syntax of the Mathematica commands. You can learn more about commands by typing ?? followed by the command name. For example: ??ContourPlot, or ?*Plot*. Under the Help icon, select the Function Navigator and explore some of the functions available in, say, Mathematics and Algorithms. For example, if you pick the subsection Calculus you can learn about the functions used to dierentiate, integrate, compute limits and series, etc. Required hand-in: The printout of some of your experiments (no more than 4 pages in total). Be creative and hand in your best examples. Make sure everything is formatted correctly before you print notebooks (no printing beyond the right edge of the paper!)

Task 3: Exploration of Mathematica 8 and Wolfram Research, Inc. The purpose of this task is to become aware of the abundance of Mathematica (related) material (mostly free!) that is available on the Internet, specically at the Wolfram Research sites. You can do this task from within Mathematica, yet I recommend to go to the listed websites directly using your (favorite) web browser. Explore the website of Wolfram Research (http://www.wolfram.com). Starting in the left column (under PROFESSIONAL & ENTERPRISE): 1. Watch the brief video overview. 2. Try some Solutions for Industry, Research and Education in a eld that you are (i) very familiar with, (ii) less familiar with, and (iii) unfamiliar with. 3. Try some interactive examples available under Built with Mathematica. This will get you to the Wolfram Demonstrations Project (http://demonstrations.wolfram.com), Wolframs free resource of interactive visualizations, where you can explore hundreds of demonstrations. Note: If you do not have Mathematica on your own PC (or Mac or Linux box), you can freely download Mathematica Player 7 and run the demonstrations. Visit the Wolfram Library Archive (http://library.wolfram.com) and Browse by Subject, e.g., in Mathematics, then in Calculus and Analysis, where you can nd articles, books, etc. If you pick an item that is available in MathSource, you have free access to the Mathematica code(s) and related notebooks. Download a few codes for experimentation. Start with familiar subjects because the available code and notebooks may not have been updated for Mathematica 8. You can go directly to MathSource: A Repository for Mathematica Packages and Programs at http://library.wolfram.com/infocenter/Mathsource/. Explore the 2D graphics, surfaces, and animations in the Mathematica Graphics Gallery, http://gallery.wolfram.com/. Explore the Mathematica GuideBooks website of Michael Trott: http://www.MathematicaGuideBooks.org. Explore some of the functions available the Wolfram Functions Site, http://functions.wolfram.com/. Learn about the Wolfram Research Application Packages for Mathematica (at an extra cost; no need to buy anything) at http://www.wolfram.com/products/fields/. Click on a couple of packages to learn what they are used for. Finally, explore E. Weissteins World of Mathematics (MathWorld), http://mathworld.wolfram.com. and E. Weissteins World of Science (ScienceWorld), http://scienceworld.wolfram.com. Pick a couple of intriguing subjects and investigate what they are about. Required hand-in: A one page summary of the subjects you visited and a printout of some of your experiments (no more than 5 pages in total). Again, be creative and hand in your best examples. 2

Task 4: Fractal Geometry and Sierpinski Triangle. Introduction: Around 1915, the Polish mathematician Waclaw Sierpinski proposed the construction of a gasket as follows. Start with an arbitrary black triangle ABC. Join the midpoints M1 , M2 , M3 of sides AB, AC and BC, respectively. This will produce 4 triangles AM1 M2 , BM1 M3 , CM2 M3 , and the middle triangle M1 M2 M3 . Each of the four triangles is similar to the original triangle. We now remove the interior of the middle triangle M1 M2 M3 leaving a triangular white whole. Metaphorically speaking, we are cutting out the heart of the triangle ABC. Cut out the heart of each of the 3 black triangles that were left after the above step. This leaves us with 9 black triangles and 4 triangular white holes. Repeat the process (cut out the heart of every black triangle) ad innitum. The above geometrical construction produces the Sierpinski triangle, Sierpinski gasket, or Sierpinski sieve. We will now use a complete dierent procedure that amazingly will lead to the same strange fractal object. The procedure is called the chaos game and proceeds as follows. To start you need an arbitrary triangle ABC and a honest dice. To each of the vertices of the triangle we assign two of the six possible outcomes of rolling the dice - say, A is assigned the numbers 1 and 2, B is assigned 3 and 4, and C is assigned 5 and 6. The idea is to give each of the three vertices an equal change of being chosen. Instead of rolling a dice, we could just as easily draw the name A, B or C out of a hat. We are now ready to play the chaos game. Roll the dice. Mark the vertex corresponding to the roll. For example, if we rolled a 5 we mark vertex C. This is our starting point. Roll the dice again. Say we roll a 2 (i.e. we have picked vertex A). We now mark the point P1 halfway between the starting position C and the chosen vertex A. Roll the dice again. Mark the point P2 halfway between the previous point P1 and the designated vertex. For instance, if the roll is 3, the point P2 will be halfway between P1 and B. Continue playing the chaos game ad innitum, each time marking the point halfway between the preceding position and the designated vertex. The Mathematica code that automates the chaos game and produces the Sierpinski (equilateral) triangle was distributed in class. Part A: Modify the Mathematica program to play the game no longer in a triangle but in any geometrical gure of your choice. Good choices are polygons or other symmetrical gures. Pick at least two dierent gures and produce the corresponding Sierpinski gaskets. Give your Mathematica programs appropriate names, e.g. squareChaosGame, etc. Required hand-in: A printout of code and graphics of your experiment. Electronic versions of code and notebook. Part B: Returning to the original Sierpinski triangle and the original chaos game, introduce weights to bias the chaos game by favoring one or two of the vertices of the triangle. Adjust 3

the Mathematica program to account for the non-uniform probabilities assigned to the vertices of the triangle. To achieve the appropriate bias, you may want to dene the selection of the functions tocenter, tobase and totop in a deterministic way, contrary to the random selection which was achieved with game[point_] := {tocenter,tobase,totop}[[Random[Integer,{1, 3}]]][point] in the original code. Write a Mathematica program called biasedChaosGame based on a new function biasgame[point ] so that the choice of the vertices (i.e., the choice of tocenter, tobase, and totop) is biased. For instance, so that totop is chosen with probability 0.8, while the two other vertices (or equivalently, tocenter and tobase ) are chosen with probability 0.1 each. Does the choice of the probabilities change the nal image, or does it merely change the way in which the nal picture is approached? Required hand-in: The printout of code and graphics of your experiment. Electronic versions of code and notebook. Part C: Go to MathWorld at http://mathworld.wolfram.com. Within MathWorld, learn more about the Sierpinski Triangle (Sieve) and Fractal Geometry in general. Depending on your current knowledge of Mathematica, either select one of the fractal structures and write Mathematica code to produce it; or look for Mathematica code on the WEB to produce it. Be creative! Required hand-in: The printout of code and graphics of your experiment. Reference the author and source of the code (perhaps yourself) you based your work on. Electronic versions of code and notebook.

Vous aimerez peut-être aussi