def most_popular(old_dic, start, end):
new_dic = cfw_
for cha in old_dic:
new_dic[cha] = 0
for item in old_dic[cha]:
if item[2]>=start and item[2]<=end:
new_dic[cha] = new_dic[cha] + item[4] +item[5]
compare_dic = cfw_
for cha in new_dic:
if new_dic[cha]
def remove_same(lst):
"(list) -> list
Return a list from lst with the same word remove from lst, except for the
first appearance of the word.
> remove_same(['Angela','Angela'])
['Angela']
> remove_same(['Andy', 'Paul', 'Lin'])
['Andy', 'Paul', 'Lin']
> re
import unittest
import tweets
class TestExtractHashtags(unittest.TestCase):
def test_no_hashtags(self):
" Test extract_hashtags with a tweet with no hashtags. "
actual_hashtags = tweets.extract_hashtags('this is a tweet!')
expected_hashtags = []
self.asse
import unittest
import tweets
class TestCommonWords(unittest.TestCase):
def test_none_removed(self):
" Test common_words with N so that no words are removed. "
words_to_counts = cfw_'cat': 1
expected_result = cfw_'cat': 1
tweets.common_words(words_to_coun
def is_palindrome (str1):
'(str) -> bool
Precondition: word only contains lowercase alphabetic letters.
Return True if and only if str1 is a palindrome.
>is_palindrome ('qwewq')
True
>is_palindrome ('qwewqd')
False
'
return str1 = str1[:-1]
def is_palindr
CHAPTER 2
2.1
DYNAMIC MODELS AND DYNAMIC RESPONSE
Revisiting Examples 2.4 and 2.5 will be helpful.
(a)
R (s) = A;
Y ( s) =
y(t ) =
(b)
KA - t / t
e
;
t
R(s) =
A
;
s
KA
t s +1
yss = 0
Y(s) =
KA
s (s + 1)
y(t) = KA (1 e t / ) ;
(c)
R(s) =
yss = KA
A
KA
; Y(
Lecture 6
6. Metric spaces
In this section we review the basic facts about metric spaces. Definitions. A metric on a non-empty set X is a map d : X X [0, ) with the following properties: (i) If x, y X are points with d(x, y ) = 0, then x = y ; (ii) d(x, y
Lecture 7
7. Baire theorem(s)
In this section we discuss some topological phenomenon that occurs in certain topological spaces. This deals with interiors of closed sets. Exercise 1. Let X be a topological space, and let A and B be closed sets with the pro
Chapter II Elements of Functional Analysis
Lecture 8
1. Hahn-Banach Theorems
The result we are going to discuss is one of the most fundamental theorems in the whole eld of Functional Analysis. Its statement is simple but quite technical. Definitions. Let
Lecture 12
3. Banach spaces
Definition. Let K be one of the elds R or C. A Banach space over K is a normed K-vector space (X, . ), which is complete with respect to the metric d(x, y ) = x y , x, y X. Example 3.1. The eld K, equipped with the absolute val
Lecture 13
4. The weak dual topology
In this section we examine the topological duals of normed vector spaces. Besides the norm topology, there is another natural topology which is constructed as follows. Definition. Let X be a normed vector space over K(
Lectures 14-15
5. Banach spaces of continuous functions
In this section we discuss a examples of Banach spaces coming from topology. Notation. Let K be one of the elds R or C, and let be a topological space. We dene K Cb () = cfw_f : K : f bounded and con
Lectures 16-17
6. Hilbert spaces
In this section we examine a special type of Banach spaces. Definition. Let K be one of the elds R or C, and let X be a vector space over K. An inner product on X is a map XX (, ) K, with the following properties: 0, X; if
A NALYSIS TOOLS W ITH APPLICATIONS
1
1. Introduction Not written as of yet. Topics to mention. (1) A better and more general integral. (a) Convergence Theorems (b) Integration over diverse collection of sets. (See probability theory.) (c) Integration rela
48
BRUCE K. DRIVER
4. The Riemann Integral In this short chapter, the Riemann integral for Banach space valued functions is dened and developed. Our exposition will be brief, since the Lebesgue integral and the Bochner Lebesgue integral will subsume the
A NALYSIS TOOLS W ITH APPLICATIONS
55
5. Ordinary Differential Equations in a Banach Space Let X be a Banach space, U o X, J = (a, b) 3 0 and Z C (J U, X ) Z is to be interpreted as a time dependent vector-eld on U X. In this section we will consider the
A NALYSIS TOOLS W ITH APPLICATIONS
423
22. Banach Spaces III: Calculus In this section, X and Y will be Banach space and U will be an open subset of X. Notation 22.1 ( , O, and o notation). Let 0 U o X, and f : U Y be a function. We will write: (1) f (x)
A NALYSIS TOOLS W ITH APPLICATIONS
197
11. Approximation Theorems and Convolutions Let (X, M, ) be a measure space, A M an algebra. Notation 11.1. Let Sf (A, ) denote those simple functions : X C such that 1 (cfw_) A for all C and ( 6= 0) < . P For Sf (A,
2 22
BRUCE K. DRIVER
12. Hilbert Spaces 12.1. Hilbert Spaces Basics. Denition 12.1. Let H be a complex vector space. An inner product on H is a function, h, i : H H C, such that (1) hax + by, z i = ahx, z i + bhy, z i i.e. x hx, z i is linear. (2) hx, y
ANALYSIS TOOLS WITH APPLICATIONS
533
29. Unbounded operators and quadratic forms 29.1. Unbounded operator basics. Denition 29.1. If X and Y are Banach spaces and D is a subspace of X , then a linear transformation T from D into Y is called a linear transf
Chapter I Topology Preliminaries
Lecture 1
1. Review of basic topology concepts
In this lecture we review some basic notions from topology, the main goal being to set up the language. Except for one result (Uryson Lemma) there will be no proofs. Definitio
Lecture 2
2. The Concept of Convergence: Ultralters and Nets
In this lecture we discuss two points of view on the notion of convergence. The rst one employs a set theoretical concept, which turns out to be technically useful. Definition. Suppose X is a xe
Lecture 3
3. Constructing topologies
In this section we discuss several methods for constructing topologies on a given set. Definition. If T and T are two topologies on the same space X , such that T T (as sets), then T is said to be stronger than T . Equ
A NALYSIS TOOLS W ITH APPLICATIONS
493
27. Sobolev Inequalities 27.1. Morreys Inequality. Notation 27.1. Let S d1 be the sphere of radius one centered at zero inside Rd . For a set S d1 , x Rd , and r (0, ), let x,r cfw_x + s : such that 0 s r. So x,r = x
4 36
BRUCE K. DRIVER
23. Sobolev Spaces Denition 23.1. For p [1, ], k N and an open subset of Rd , let
k,p Wloc () := cfw_f Lp () : f Lp () (weakly) for all | k , loc
W k,p () := cfw_f Lp () : f Lp () (weakly) for all | k , (23.1) and (23.2) kf kW k,p
P DE LECTURE NOTES, M ATH 237A-B
157
11. Introduction to the Spectral Theorem The following spectral theorem is a minor variant of the usual spectral theorem for matrices. This reformulation has the virtue of carrying over to general (unbounded) self adjo
P DE LECTURE NOTES, M ATH 237A-B
185
14. Wave Equation on Rn (Ref Courant & Hilbert Vol II, Chap VI 12.) We now consider the wave equation (14.1) According to Section 13, the solution (in the L2 sense) is given by p sin(t 4) g. (14.2) u(t, ) = (cos(t 4)f
3 68
BRUCE K. DRIVER
19. Weak and Strong Derivatives For this section, let be an open subset of Rd , p, q, r [1, ], Lp () = Lp (, B , m) and Lp () = Lp (, B , m), where m is Lebesgue measure on BRd loc loc and B is the Borel algebra on . If = Rd , we wil