<commit_before>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import walk2Dv as wlk\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import flip_coin_vec as fcv"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# Classwork 10\n",
    "## <NAME> Will\n",
    "### Problem 1. \n",
    "Simulate a coin flip N times, and write out the number of tails. All code should be vectorized. \n",
    "\n",
    "The code for this one was very short and fairly straightforward. Here are the results of ten flips, carried out ten times."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "6\n",
      "6\n",
      "4\n",
      "5\n",
      "7\n",
      "7\n",
      "7\n",
      "5\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "for i in range(0,10):\n",
    "    print(fcv.flipCoin(10))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problems 2 and 3. \n",
    "Simulate the random walk problem in 2 dimensions, using vectorized code where possible. Then create a Gif of the random walk for 1000 particles taking 400 steps. \n",
    "\n",
    "The code I implemented was a cleaned-up version of the code in the book. I also went a little nuts with ImageMagick and subsequently FFMpeg. I couldn't find a way to embed them in a Jupyter notebook, so they are attached as separate files in the repository."
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",<commit_msg>included gif in the notebook<commit_after>{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "import walk2Dv as wlk\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import flip_coin_vec as fcv"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "# Classwork 10\n",
    "## <NAME>\n",
    "### Problem 1. \n",
    "Simulate a coin flip N times, and write out the number of tails. All code should be vectorized. \n",
    "\n",
    "The code for this one was very short and fairly straightforward. Here are the results of ten flips, carried out ten times."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "5\n",
      "6\n",
      "6\n",
      "4\n",
      "5\n",
      "7\n",
      "7\n",
      "7\n",
      "5\n",
      "3\n"
     ]
    }
   ],
   "source": [
    "for i in range(0,10):\n",
    "    print(fcv.flipCoin(10))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Problems 2 and 3. \n",
    "Simulate the random walk problem in 2 dimensions, using vectorized code where possible. Then create a Gif of the random walk for 1000 particles taking 400 steps. \n",
    "\n",
    "The code I implemented was a cleaned-up version of the code in the book. I also went a little nuts with ImageMagick and subsequently FFMpeg. Without further ado, here is a gif of 1000 particles taking 400 steps each:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "![There should be a gif](walk.gif \"Random Walk in 2D\")"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python [default]",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
{'fraction_non_alphanumeric': 0.1685929648241206, 'fraction_numerical': 0.018090452261306532, 'mean_word_length': 2.3794567062818337, 'pattern_counts': {'":': 67, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5639905', 'n_tokens_mistral': 1485, 'n_tokens_neox': 1421, 'n_words': 427}