Rechenkurs GAP (Wintersemester 2014/2015)
- Veranstalter: Prof. Dr. Max Horn
- Termin Übung: Jeden Donnerstag 10:00 - 12:00 Uhr in PC-Labor des Mathematischen Instituts
News
- 2015-10-09
- Update for sheet 2: explain how "for"-loops in GAP work in more detail
- 2015-09-14
- Some cosmetic revisions
- 2014-11-06
- Add the "bad locals" example
- 2014-11-05
- Uploaded slightly revised versions of worksheets 3 and 4
Worksheets
- sheet0-install.pdf
- sheet1-basics.pdf
- sheet2-linAlg.pdf
- sheet3-functional.pdf
- sheet4-perms.pdf
- sheet5-misc.pdf
- sheet6-groups.pdf
- sheet7.pdf
Bonus problems
Bonus problems are good for a bonus homework point each.Sieve (deadline 20. November 2014)
Write a functionSieve(n)which takes a positive integern, and returns a list containing all primes less or equaln, in strictly ascending order. Compute this list using the sieve of Eratosthenes. Submit your solution in a file calledsieve.g.Your program should be able to compute
Sieve(10^7)in under 20 seconds.Hint: You can use the function
RootIntto compute an integer approximation of the square root of an integer (consult the manual to learn how to use it). However, it is also fine to write a solution working without it.Hint: The function
Addmay also be useful: It can append a single element to the end of a list (again, please consult the GAP manual for details).
Miscellaneous
The perils of not using local properly
You can find the "bad" example from today's class here.
Autor: Max Horn