CSC 223 - Advanced Scripting for Data Science, Fall 2024, MonWed 3:00-4:15 and 4:30-5:45 PM, Old Main 159.

Assignment 1 Specification,
code is due by end of TBD via make turnitin on acad or K120023GEMS.


Perform the following steps on K120023GEMS after logging into your account via putty or ssh:

cd                                    # places you into your login directory
mkdir Scripting              # all of your csc523 projects go into this directory
cd  ./Scripting                 # makes Scripting your current working directory, it may already exist
cp  ~parson/Scripting/CSC223f24SORTassn1.problem.zip  CSC223f24SORTassn1.problem.zip
unzip  CSC223f24SORTassn1.problem.zip    # unzips your working copy of the project directory
cd  ./CSC223f24SORTassn1                            # your project working directory

Perform all test execution on K120023GEMS to avoid any platform-dependent output differences.
The project makefile drives testing via running make test on
K120023GEMS.
Here are the files of interest in this project directory. You can ignore makelib.


CSC223f24SORTassn1.py                # This is the Python source file you will edit.
makefile                                             # This script directs the actions of make clean test and make turnitin.
makelib                                              # This is my library used by makefile.

Students will do two things within the above Python file for Assignment 1.

1. Implement a radix sort using a pseudo-random radix that is a power of 2.
    A valid outline of the radix sort is here.
    I am requiring an unusual, cryptic version of this algorithm to avoid downloads of fixed-radix solutions.
    You must follow the psuedo-code already written in the handout Python file or lose most points.
2. Implement an insertion sort using the Python bisect library module, also fully specified in the handout code.

You can type make student from within the project directory to see your requirements.
Here they are with preceding line numbers, reordered in order of work items.
You should search for all upper-case STUDENT comments and of course understand the handout code.
Please take notes when I go over this in class.

    11         # STUDENT 1: 1% Complete documentation at top of CSC223f24SORTassn1.py.
   120        # STUDENT 2 (10%) Open an output file into variable outfile for writing
   150        # STUDENT 3 (4%) Close the two files you opened for writing in STUDENT 2.
    39         # STUDENT 4 (50%) Implement ourRadixSort according to my pseudo-code.
    96         # STUDENT 5 (35%) Implement ourInsertionSort using bisect.insort_right.

You can see all STUDENT details when you edit
CSC223f24SORTassn1.py.

Type make clean test on machine xxx when you are ready to test.
I will go over how to interpret any .dif file that shows the differences between your output
    and the expected .ref reference output.
When you have completed all work and make test works correctly, type make turnitin
    and hit Enter when prompted to turn in the code. We are NOT using the turnin script.
    You will not receive email after make turnitin. If make doesn't report an error, it worked.
    There is a 10% per-day penalty for all late projects in this course.
    Any project turned in during or after the class in which I go over a solution is worth 0%

References

Student 2 and 3 Python open and close of text files.
    Don't specify encoding but do include newline='' as directed.
Student 4 math (for ceil and log2) and copy.copy.
Student 5 bisect library module.
Library modules and class used in my __main__ driver code include
    random, numpy.random.Generator, with its exponential generator constructor.
    Here is a graph of an exponential distribution from another course.

Here is a doc with a reasonable diagram explaining radix sort at the top.
    Do NOT use code from that page or any other external source.
    Our code is using a pseudo-random, varying radix that is a power of 2.
    You will not find that on the web. Just translate my pseudo-code to Python.

Python operators that I will demo in class:

    <<        bitwise shift left
    >>       
bitwise shift right
    |           bitwise OR
    &         
bitwise AND

    and       logical (boolean) AND
    or          logical (boolean)
OR
    *, +, -    multiply, add, subtract
    /            floating point division retains the fraction

    //           integer division discards the fraction