Jiayu:
KHOOR, MXOLDQR!
L KRSH BRX HQMRB BRXU KROLGDB. KROLGDB.
Professor Kate Poirier, Spring 2017
Jiayu:
KHOOR, MXOLDQR!
L KRSH BRX HQMRB BRXU KROLGDB. KROLGDB.
YT GJ TW STY Yt GJ. YMFY NX YMJ VZJXYNTS.
I know two other students wrote an algorithm in Java and C++, but I had finished my code right after class the other day and forgot to post on here. Incase others wanted to see another way to solve it, I used JavaScript.
background(255, 255, 255);
var m = 30;
var i = 0;
var x = 7;
var a = 19;
var c = 8;
var num, div, num1, mod;
while( i <10){
var change = (i+1) * 25;
num = (a*x)+c;
div = floor(num/ m);
num1 = div*30;
fill(0, 0, 0);
text(x, 100,change);
x= num-num1;
i++;
}
In the above code, I declared/ initialized some variables. I used a While loop using "i" as a counter. I have the variables outside the loop as a static number and "change", "num", "div", "num1", "x" as a variable inside the loop that will continuously change each time the program loops.
I hope this helps if anyone was confused, or wanted to see another solution. Feel free to message/ reply to this post if you have questions.
I attached a screenshot I took. I wrote the code in Khan Academy since the website lets you write programs and run them.
Also, the variable “change” is just used to format where I want the text to print the number. You can see that in the text command where I text “x” and then place it at 100 on the X-axis and the “change” is the Y-axis. The X- axis is always at 100 and the “change” keeps changing on the Y-axis by 25 pixels each loop.
While MATLAB is the official requirement for this assignment, and is installed on most computers in CityTech labs, a free alternative to MATLAB is Scilab. You might like to practice on Scilab if you will not have access to MATLAB during the break but do have access to a computer that you can install software on. Commands in Scilab are similar to the commands in MATLAB, but they’re not necessarily identical, so you may find the MATLAB-Scilab equivalence page helpful. You will have to convert to MATLAB after you arrive back on campus after the break.
For this assignment, form teams of 2-3 students. There are two goals for this assignment:
Before starting your conversation, you and your partner(s) must choose how you will encrypt your messages. Read pages 294-297 and, together with your teammates, choose a shift cipher, an affine cipher, or a block cipher to use. Keep this information private. Decide who will post the first message.
One team member will post the first message as a new post on the OpenLab. Title your post “Code-breaking” and the names of all the team members (not encrypted). Select the “Code-breaking” category from the right-hand side of the screen. The message can be as long as you want, but it must be at least two sentences long and must be entirely encrypted. It will look something like:
L ZLOO EH UHDOOB KDSSB LI BRXU HQFRGHG PHVVDJHV DUH VLOOB MRNHV RU IXQQB VWRULHV. MXVW PDNH VXUH WKDW WKHB DUH QRW WRR LQDSSURSULDWH!
After the first message is posted, other team members can add their encrypted responses as comments on their teammate’s post. Every team member must post at least one message. Messages don’t need to say anything in particular. You can tell a story together or ask each other questions. You can be silly or you can be serious. Keep posting encrypted messages until someone else breaks your code.
After enough encrypted messages have been posted, try breaking another team’s code. If you break it, post a comment on their thread with the decrypted messages along with the kind of cipher they chose, and the information you needed to decrpyt it. If you and a partner work together to break another team’s code, make sure to credit them in your post. You can try breaking as many other teams’ codes as you like, but you may only post the decrypted code for one team.
First post due by Tuesday, April 11. All teammates’s comments due by Thursday, April 13.
We’ll see how many codes have been broken by our first class meeting after spring break!
You might find the Khan Academy unit on cryptography (including videos) to be useful.
As announced in class, Test #2 will be given in class this Thursday. The test will cover sections 2.3, 2.4, 2.5, 4.1, 4.2, 4.3 (everything since Test #1).
a=superman is able to prevent evil
b= superman is impotent
c=superman is willing to prevent evil
d=superman is malevolent
e= superman exsists
f= superman prevents evil
argument form=
(a∧c)→f
¬a→b
¬c→d
¬f
e→¬b∧¬d
___________________
:.¬e
Argument =
(we have to prove ¬e)
¬a→b
¬c→d
e→¬(b∧d)
*i am lost after this
i know this is supposed to look like this
and pg 73 of the book has it but i dont really understand how the substituting works
this website explains more about building arguments:
http://sites.millersville.edu/bikenaga/math-proof/rules-of-inference/rules-of-inference.html
© 2024 MAT2440 Discrete Structures & Algorithms I
Theme by Anders Noren — Up ↑
Recent Comments