{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "###ANSWER\n",
    "(for making sure this gets removed)\n",
    "\n",
    "### INSTRUCTOR CONTENT -- REMOVE THIS IN STUDENT VERSION\n",
    "#### The goals for this class are:\n",
    "1. Make sure the students understand the goals for the course and the course structure.\n",
    "2. Ensure that students have a functioning verion of python 3.7 installed on their laptop, if not, they can use JupyterHub for today, but make it clear that they should try to get their location installation working. (all students will test out their access to JupyterHub)\n",
    "3. Make sure students understand that they will be responsible for downloading a notebook in every class at that they will have to upload it at the end of class.\n",
    "4. Students should spend some time getting to know each other a bit by doing introductions and then doing an icebreaker activity as a group"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "### <p style=\"text-align: right;\"> &#9989; **Put your name here** </p>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "# Welcome to CMSE202\n",
    "# Day 1 In-class Notebook\n",
    "\n",
    "<img src=\"https://cmse.msu.edu/sites/_cmse/assets/Image/image001.png\" width= 400><p style=\"text-align: right;\">\n",
    "Image from https://cmse.msu.edu/\n",
    "</p>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Agenda for today's class\n",
    "\n",
    "</p>\n",
    "\n",
    "1. Getting started\n",
    "2. Pre-Course Survey (for those that haven't)\n",
    "3. Review the class syllabus and in-class procedures\n",
    "4. Group Introductions\n",
    "5. Plans to solve problems \n",
    "6. End-of-class survey"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "------\n",
    "# 1. Lets get started"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### &#9989; Do This - Get out your laptop\n",
    "* Feel free to grab one of the laptops in the classroom if you do not have your own. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### &#9989; Do This - Download this jupyter notebook\n",
    "* Go to the class <a href=\"https://d2l.msu.edu/\">D2L</a> page and download a copy of this notebook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "### &#9989; Do This - Activate your engineering account \n",
    "\n",
    "When you enrolled in class you should have received an engineering login.  If you haven't already, go to the following URL to activate the account and set your password.\n",
    "\n",
    "https://www.egr.msu.edu/decs/myaccount/?page=activate"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### &#9989; Do This - Try logging into the Engineering JupyterHub Website\n",
    "\n",
    "http://jupyterhub.egr.msu.edu\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### &#9989; Do This - Try uploading this notebook into JupyterHub\n",
    "Make sure you understand how this process works and once you do, exit JupyterHub (unless you don't have Python successfully installed on your laptop)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "------\n",
    "# 2. Pre-Course Survey\n",
    "\n",
    "**If you didn't already complete the pre-course sent to you in an email**, please take a moment to do it now.\n",
    "\n",
    "#### &#9989; Do This - Execute the cell below by pressing shift+enter with the cell highlighted and complete the pre-course survey."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<iframe src=\"https://forms.gle/nHHJeVNbKj3ZAhDe6\"\n",
       "width=\"800px\"\n",
       "height=\"600px\"\n",
       "frameborder=\"0\"\n",
       "marginheight=\"0\"\n",
       "marginwidth=\"0\">Loading...</iframe>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import HTML\n",
    "HTML(\n",
    "\"\"\"\n",
    "<iframe src=\"https://forms.gle/nHHJeVNbKj3ZAhDe6\"\n",
    "width=\"800px\"\n",
    "height=\"600px\"\n",
    "frameborder=\"0\"\n",
    "marginheight=\"0\"\n",
    "marginwidth=\"0\">Loading...</iframe>\n",
    "\"\"\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "------\n",
    "# 3. Review the class syllabus and in-class procedures\n",
    "\n",
    "### &#9989; Do This - Go to D2L and download the syllabus.\n",
    "\n",
    "* Read through the syllabus and note any questions you may have.\n",
    "\n",
    "* We will go through the syllabus as a class. \n",
    "\n",
    "* **Note:** If you're interested in doing an honors option, please contact me via email to discuss this.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Day-to-day class structure\n",
    "We are going to try and form some class habits to make things go smoothly and help keep us on task.\n",
    "\n",
    "**Step 1:** Download the pre-class notebook from the class Desire to learn (D2L) website or from the GitHub repository (we'll explain this later). Watch any associated videos, answer questions, complete the assignment and turn it in by 11:59 pm the day before class. Ideally, pre-class notebooks will be posted ~48 hours before it is due.\n",
    "\n",
    "**Step 2:** When you show up to class.  Sit with your assigned groups, if specified, and download the in-class notebook from the class D2L website or the GitHub respository. \n",
    "\n",
    "**Step 3:** Read through the notebook to get an idea about what we will be doing in class.\n",
    "\n",
    "**Step 4:** Complete that day's group and individual work shown in the notebooks. Most notebooks will have activities that can be conducted as soon as you get to class, but we might occasionally have a bit of class-wide discussion before we get started.\n",
    "\n",
    "**Step 5:** Complete the in-class feedback survey (if there is one). \n",
    "\n",
    "**Step 6:** Put your name(s) on the notebooks and at the end of class turn them in to the Desire to learn (D2L) website.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "------\n",
    "# 4. Group Introductions  \n",
    "\n",
    "**We will start by randomly moving people in the room, please go where the instructor tells you.**  \n",
    "\n",
    "Once you are at your new seat, introduce yourself to your neighbor.  You will talk to your neighbor for 5 minutes and then *you* will introduce them to the rest of your group by sharing their answers the following questions. \n",
    "</p>\n",
    "\n",
    "1. What is your neighbors name?\n",
    "2. What is your neighbors major?\n",
    "3. Why is your neighbor taking this class?\n",
    "4. What was the most interesting thing that you neighbor did or had happen to them during the break?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "------\n",
    "# 5. Planning to solve problems\n",
    "For our first activity of the semester, I want you to think about how you would solve a problem successfully.  I want us to focus less on the code and more on the process.  \n",
    "\n",
    "Consider the following problem:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Gift Exchange Problem\n",
    "We would like to write a gift exchange program that lets everyone in a group get a present from someone else.  \n",
    "\n",
    "Assume you have a group of $N$ individuals ($P_1, P_2, P_3, \\dots, P_N$). Also assume that you have $M$ households ($H_1, H_2,...H_M$) Each person is a member of at least one household ($ e.g. P_1 \\in H_1, P_2 \\in H_2, P_3 \\in H_5$, etc) and a given household can be home to more than one person. \n",
    "\n",
    "**Note:** the $\\in$ symbol is commonly used in math and represents membership. We typically say \"in\" so $P_1 \\in H_1$ would be read \"P one in H one\"\n",
    "\n",
    "Think about how you would write a program to randomly select an anonymous name from the list to give each person.  We would like this exchange to adhere to the following rules:\n",
    "\n",
    "1. Every person should give one, and only one, gift.\n",
    "1. Every person should receive one, and only one, gift.\n",
    "1. A person can not give themselves a gift.\n",
    "1. A person can not give a gift to someone in their own household. \n",
    "1. Whenever possible the person receiving the gift should not know from whom the gift was given. For example, If person $a$ ($P_a$) gives a gift to person $b$ ($P_b$) then it is possible that $P_b$ gives a gift to $P_a$. However, this must not be true for all $a$ and $b$. i.e. we can't just pair people up or it will no longer be anonymous."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "&#9989; Individually, write the steps you would take to solve this problem successfully.  What would you do first?  What would you do last?  Again, the goal is not to solve the problem, the goal is to come up with a plan that will allow you to solve the problem.  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=8 color=\"#009600\">&#9998;</font> Do This - Erase the contents of this cell and replace it with your answer to the above question!  (double-click on this text to edit this cell, and hit shift+enter to save the text)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "&#9989; In your groups, discuss each of your plans. Think about things you may have missed in your own plan.  Modify or pick a plan that represents the group.  Take note of what is in the group plan that is not in your own plan. **It might be useful to make use of the whiteboards for this part!**"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=8 color=\"#009600\">&#9998;</font> Do This - Erase the contents of this cell and replace it with your notes from the above question!  (double-click on this text to edit this cell, and hit shift+enter to save the text)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "&#128101; As a class, each group will present their favorite plan.  Take notes below about ideas other groups had that you think are good and would like to include in your plan. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<font size=8 color=\"#009600\">&#9998;</font> Do This - Erase the contents of this cell and replace it with notes from the above question!  (double-click on this text to edit this cell, and hit shift+enter to save the text)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### ###ANSWER\n",
    "\n",
    "Ideally, individually and as a group students will come up with plans similar to the following: \n",
    "\n",
    "1. Understand the problem/constraints\n",
    "2. Divide problem into logical components (data structures, functions, objects)\n",
    "3. Draw a picture/pseudocode\n",
    "4. Implement single component at a time & test\n",
    "5. Integrate components & test\n",
    "6. Test full solution.\n",
    "\n",
    "Other things you may see:\n",
    "\n",
    "* Come up with a couple of examples and work them out on paper (or their marker boards).\n",
    "* Generate a list of the basic data structures you think will work for the problem. For example, this problem would probably use dictionaries to represent homes of people.  \n",
    "* Write up a basic overview of the program structure. We would call this pseudocode, or flowcharts.  \n",
    "* Come up with a plan to determine if the resulting program is successful. \n",
    "* Generate some \"stub\" functions and select inputs and outputs.\n",
    "* Research any  the \"unknown knowledge\" in this\n",
    "* Select order of function writing and testing.\n",
    "* Write and test code in order selected. Iterate as needed. \n",
    "* Verify the program is successful using the plan determined earlier.\n",
    "\n",
    "This is fairly open-ended so different students will focus on different things. The trick is not to try to get students to come up with our list (that will come later). Instead I just want them to start thinking about solving problems at the \"meta\" level. Some key items we are looking for include:\n",
    "\n",
    "* Did they include a step to solve the problem by hand?\n",
    "* Did they include any pseudocode and/or stub functions?\n",
    "* Did they include any testing/verification steps?\n",
    "\n",
    "Instructors should help identify missing items during the group discussion.  Grading of this assignment can primarily be based on completion but since everyone will be discussing this we can use this as a test to see if students are wide off the mark. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "----\n",
    "\n",
    "# 6. Day 1 Wrap-up\n",
    "\n",
    "### &#9989; Do This - Fill out the Google Form below before turning in your notebook on D2L.    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<iframe src=\"https://forms.gle/oNMviLgj8XQaNPJ99\"\n",
       "width=\"800\"\n",
       "height=\"600\"\n",
       "frameborder=\"0\"\n",
       "marginheight=\"0\"\n",
       "marginwidth=\"0\">Loading...</iframe>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from IPython.display import HTML\n",
    "HTML(\n",
    "\"\"\"\n",
    "<iframe src=\"https://forms.gle/oNMviLgj8XQaNPJ99\"\n",
    "width=\"800\"\n",
    "height=\"600\"\n",
    "frameborder=\"0\"\n",
    "marginheight=\"0\"\n",
    "marginwidth=\"0\">Loading...</iframe>\n",
    "\"\"\"\n",
    ")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "-----\n",
    "## Congratulations, you're done with your first in-class assignment!\n",
    "\n",
    "Now, you just need to submit this assignment by uploading it to the course <a href=\"https://d2l.msu.edu/\">Desire2Learn</a> web page for today's assignment submission folder. (Don't forget to add your name in the first cell!)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "&#169; Copyright 2018,  Michigan State University Board of Trustees"
   ]
  }
 ],
 "metadata": {
  "anaconda-cloud": {},
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
