sets/slides.tex
author Puneeth Chaganti <punchagan@fossee.in>
Wed, 13 Oct 2010 11:13:46 +0530
changeset 314 11869b16d86b
parent 281 d91133654fc8
child 427 c193744340ba
permissions -rw-r--r--
Getting started with sagenotebook LO - script and questions.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     1
% Created 2010-10-10 Sun 23:53
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     2
\documentclass[presentation]{beamer}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
\usepackage[latin1]{inputenc}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     4
\usepackage[T1]{fontenc}
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     5
\usepackage{fixltx2e}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     6
\usepackage{graphicx}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     7
\usepackage{longtable}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     8
\usepackage{float}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
     9
\usepackage{wrapfig}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    10
\usepackage{soul}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    11
\usepackage{textcomp}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    12
\usepackage{marvosym}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    13
\usepackage{wasysym}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    14
\usepackage{latexsym}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    15
\usepackage{amssymb}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    16
\usepackage{hyperref}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    17
\tolerance=1000
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    18
\usepackage[english]{babel} \usepackage{ae,aecompl}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    19
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    20
\usepackage{listings}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    21
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    22
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    23
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    24
\providecommand{\alert}[1]{\textbf{#1}}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    25
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    26
\title{Sets}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    27
\author{FOSSEE}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    28
\date{}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    29
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    30
\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    31
\begin{document}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    32
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    33
\maketitle
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    34
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    35
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    36
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    37
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    38
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    39
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    40
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    41
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    42
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    43
\begin{frame}
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    44
\frametitle{Outline}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    45
\label{sec-1}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    46
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    47
\begin{itemize}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    48
\item Defining Sets
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    49
\item Operations on sets
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    50
\end{itemize}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    51
\end{frame}
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    52
\begin{frame}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    53
\frametitle{Question 1}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    54
\label{sec-2}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    55
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    56
  Given a list of marks, \texttt{marks = [20, 23, 22, 23, 20, 21, 23]} list
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    57
  all the duplicates
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    58
\end{frame}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    59
\begin{frame}[fragile]
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    60
\frametitle{Solution 1}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    61
\label{sec-3}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    62
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    63
\lstset{language=Python}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    64
\begin{lstlisting}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    65
marks = [20, 23, 22, 23, 20, 21, 23] 
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    66
marks_set = set(marks)
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    67
for mark in marks_set:
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    68
    marks.remove(mark)
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    69
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    70
# we are now left with only duplicates in the list marks
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    71
duplicates = set(marks)
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    72
\end{lstlisting}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    73
\end{frame}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    74
\begin{frame}
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    75
\frametitle{Summary}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    76
\label{sec-4}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    77
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    78
  You should now be able to --
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    79
\begin{itemize}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    80
\item make sets from lists
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    81
\item input sets directly
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    82
\item perform operations like union, intersection, symmetric difference
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    83
\item check if a subset of another
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    84
\item check containership, length and other properties similar to lists
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    85
\end{itemize}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    86
\end{frame}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    87
\begin{frame}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    88
\frametitle{Thank you!}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    89
\label{sec-5}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    90
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    91
  \begin{block}{}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    92
  \begin{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    93
  This spoken tutorial has been produced by the
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    94
  \textcolor{blue}{FOSSEE} team, which is funded by the 
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    95
  \end{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    96
  \begin{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    97
    \textcolor{blue}{National Mission on Education through \\
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    98
      Information \& Communication Technology \\ 
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    99
      MHRD, Govt. of India}.
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   100
  \end{center}  
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   101
  \end{block}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   102
\end{frame}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   103
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   104
\end{document}