When I read Matt Cheung's slog, he gives some examples to distinguish well-defined functions from not well-defined function. I feel that it is very clear.
- well defined: x = {1, 2, 3, 4}, y = {a, b, c, d}
- not well defined: x = {1, 2, 3}, y = {a, b, c, d}
- not well defined: x = {1, 2, 3, 4}, y = {a, b, c}
Danny said that well-defined functions have to be 1-1 and onto. The last two example violate 1-1 and onto respectively. Therefore, they are not well-defined function.
In the Lukas Frantzke's slog, he/she talked about his./her opinion about infinite loop. He/she mentioned that infinite loop is different from long running time. Sometime it is very hard to tell which one the program counters. Last year, when I took csc108, some program that I wrote took more than 3 minutes to run. In the beginning, I thought there was a error in my program; however, it eventually returned a value.
No comments:
Post a Comment