26 Mar 2014
#####Entropy is the optimal(best we can do) of infomation compression
####About greedy algorithm
- You don’t have to show that your greedy algorithm beats OPT, you just need to show that it’s as good as the OPT
- Proving greedy algorithm:
###Problem 1
To disprove it, just try find counterexamples
###Problem 2
Greedy algorithm is not always the solution, if it’s the case, try some other algorithms
###Problem 3
When swap into OPT, make sure that it’s at least as good as OPT
###Problem 4
- Shannon-Fano is not good, you need to modify it to make it actually work
- If encoding individually is not good, try encoding grouply
- Proof technique: use contradiction when it’s not easy to quantitize the constraints
- Lempel-Ziv is a good compression algorithm
###Problem 5
- Huffman encoding is guaranteed to be within range of
- For infomation with low entropy, use Huffman combined with run-length
25 Mar 2014
Multivariate linear regression
####Improve Gradiant Descent
####Normal Equation
####Invertibility
Why can be non-invertible
20 Mar 2014
#####Notes
- Test driven
- Extreme value
- lexigraphic ordering
- use the comparator function, not the item itself
- computing v.s. doing
- computing: return result, pure functions
- doing: doesn’t return result, inpure functions or subroutines
It's easy to test pure functions
#####Python features:
- Same function can have different return type(dynamic typing system)
- The use of ‘–234’.index(r)
- The use of list.count
- list: reversed
#####Refactoring
- DRY: don’t repeat yourself
#####Lesson Learned
- understand
- define pieces
- reuse
- test
- explore the design space
- correctness
- efficiency
- elegance
- features
19 Mar 2014
###Leader Election in Ring
####Take away
-
Using libraries
It’s standard notions so you already understand it. And it reduces the risk of mistakes.
####Question
- How to modify the model to allow message to be dropped?
-
Each step only one process send id?(concurrency)
Dealt with in fact Traces
- Step may send itself out again.
- The discussion for section 4
###Memory
####Take away
- Abstraction function
####Question
- Different address can hold the same data?
- Alpha function v.s. alpha predicate