sets/slides.tex
author bhanu
Thu, 11 Nov 2010 02:16:07 +0530
changeset 477 0406115dccd1
parent 427 c193744340ba
permissions -rw-r--r--
language check done for `matrices`
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
427
c193744340ba Cleaned up sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 281
diff changeset
     1
% Created 2010-11-09 Tue 17:14
281
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
427
c193744340ba Cleaned up sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 281
diff changeset
    70
# we are now left with only duplicates
c193744340ba Cleaned up sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 281
diff changeset
    71
# in the list marks
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    72
duplicates = set(marks)
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    73
\end{lstlisting}
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    74
\end{frame}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    75
\begin{frame}
281
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    76
\frametitle{Summary}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    77
\label{sec-4}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    78
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    79
  You should now be able to --
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    80
\begin{itemize}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    81
\item make sets from lists
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    82
\item input sets directly
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    83
\item perform operations like union, intersection, symmetric difference
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    84
\item check if a subset of another
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    85
\item check containership, length and other properties similar to lists
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    86
\end{itemize}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    87
\end{frame}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    88
\begin{frame}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    89
\frametitle{Thank you!}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    90
\label{sec-5}
d91133654fc8 Slides for sets LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 233
diff changeset
    91
233
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    92
  \begin{block}{}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    93
  \begin{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    94
  This spoken tutorial has been produced by the
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    95
  \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
    96
  \end{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    97
  \begin{center}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    98
    \textcolor{blue}{National Mission on Education through \\
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    99
      Information \& Communication Technology \\ 
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   100
      MHRD, Govt. of India}.
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   101
  \end{center}  
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   102
  \end{block}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   103
\end{frame}
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   104
ab748264f726 Made sets.rst into the new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   105
\end{document}