Category Archives: Class work

Mandelbrot Set

Faster Madelbrot

Speed up Mandelbrot by performing the computation directly instead of using Complex. Compare. Incorporate periodicity checking or boundary tracing for further improvements. Use divide-and-conquer: choose 4 corners of a rectangle and a few random points inside; if they’re all the same color, color the whole rectangle that color; otherwise divide into 4 rectangles and recur.

screen-shot-2016-09-19-at-8-43-22-pm

Euclidean Points

Screen Shot 2015-09-07 at 9.38.05 PM   Screen Shot 2015-09-07 at 9.41.17 PM

ADTs refresher Project
Euclidean points. Create a data type EuclideanPoint (prefix your file with your initials YI_EuclideanPoint.java) that represents a d-dimensional point.
1. Write a method so that p.distanceTo(q) returns the Euclidean distance between points p and q.
2. Write a method so that p.midPoint(q) returns the Euclidean mid-point between points p and q.
3. Include a test class with at least three pair of points with different dimensions.
4. Before you start the implementation, use paper and pencil to show few examples using illustrations and computations.

screen-shot-2016-09-19-at-5-25-49-pm

Cryptography – Caesar Cypher – Third Day

September 11th, 2017

The Caesar Cipher

The key for the Caesar Cipher will be a number from 1 to 26. Unless you know the key (that is, know the number used to encrypt the message), you won’t be able to decrypt the secret code.

The Caesar Cipher was one of the earliest ciphers ever invented. In this cipher, you encrypt a message by taking each letter in the message (in cryptography, these letters are called symbols because they can be letters, numbers, or any other sign) and replacing it with a “shifted” letter. If you shift the letter A by one space, you get the letter B. If you shift the letter A by two spaces, you get the letter C. Figure 14-1 is a picture of some letters shifted over by three spaces.

 

To get each shifted letter, draw out a row of boxes with each letter of the alphabet. Then draw a second row of boxes under it, but start a certain number (this number is the key) of spaces over. After the letters at the end, wrap around back to the start of the boxes. Here is an example with the letters shifted by three spaces:


Invent with Python

Making paper cryptography paper tools

 


A virtual Cipher Wheel

Assignments: visit edmodo.com to submit your work
My Cipher – Clwk 9/11/2017 – Caesar Cipher Device

1. Look at the Caesar Cipher Device on the link below. Create your own cipher and a device that can be used to encrypt and decrypt your messages.

2. Write a java program to encrypt and decrypt messages using your new cipher. Use the university SdtDraw.java to draw the device you designed for your cipher. The drawing is a representation of the cipher.

1. The program should display 2 options:
e. Encrypt a message
d. Decrypt a message
x. Exit

2. Prompt the user for the “key”. Make sure your prompt for the “key” includes all the information necessary for the user to understand what is needed when the message is decoded.

NOTE: The program should continue to display the menu until the user exits the application.

BAD Ciphers: reversing the order, flipping the letters, reversing and flipping the letters of the message, and anything that is similar to the Caesar Cipher with a silly twist to it.

DOCUMENTATION:
Header:


/** 
Full assignment description
Your Name
Date
**/

If there is any obfuscated code snippet, you must include a comment!

Footer:


/**
Multiple Input/output sessions.
**/

NOTE: your program name: MyCipher_YI.java

Hash Tables – Uniform hashing

Screen Shot 2015-04-10 at 7.21.43 AM

Classwork:
1. At classroomSalon.com:
Video 11.1 has questions.
Please type “done” in edmodo.com when you are finished.

2. At edmodo.com:
Uniform hashing assumptions:
From Video 11.1:

uniformHashingAssumptions

Coupon collector. Suppose that you have a shuffled deck of cards and you turn them face up, one by one. How many cards do you need to turn up before you have seen one of each suit? This is an example of the famous coupon collector problem. In general, suppose that a trading card company issues trading cards with N different possible cards: how many do you have to collect before you have all N possibilities, assuming that each possibility is equally likely for each card that you collect?

Illustrate the assumption made in the video either mathematically or with program YI_CouponCollector.
NOTE: Be clear and concise

Homework:
At classroomSalon.com:
Video 11.2 has questions.
Please type “done” in edmodo.com when you are finished.

NOTE: Classroomsalom.com has gone mobil now!!!!