Unit analysis should help here. We want number of bananas



Download 12.14 Kb.
Date18.10.2016
Size12.14 Kb.
Solutions

  1. Unit analysis should help here. We want number of bananas.









  1. Working Javascript example: http://jsbin.com/topamu/edit?html,js,console

function isComposite(y){

var primal=0;

if(y==2 || y==3){

primal = 0;

}

for(i=2; i<=Math.sqrt(y); i++){



if(y%i===0){

primal = primal+1;

}

}

if(primal>0){



primal =1;

}

return primal;



}
//console.log(isComposite(541)); //should be 0

//console.log(isComposite(24)); //should be 1


var j=2;

var sumDiff=0;

var toggle =1;

var countOfNumbers= 1;


while(countOfNumbers<301){

if(isComposite(j) === 0){

sumDiff=toggle*j + sumDiff;

toggle = -toggle;

countOfNumbers++;

}

j++;



}
console.log(sumDiff);


  1. D (inverse of XOR)

Let XOR = let NAND =

A

B

A XOR B

0

0

0

0

1

1

1

0

1

1

1

0

A

B

A AND B

0

0

1

0

1

1

1

0

1

1

1

0











0

1

0

1

1

1

1

0

1

1

1

0

0

0

0

1



  1. Try relating the + signs and * signs to what you know about set theory

  2. Known vulnerability examples:

  • Many customer service representatives have access to plaintext passwords given only a date of birth and address. This means you could hack practically anyone you’re friends with on Facebook

  • Anyone can impersonate IT support and could be keylogging everyone without anyone knowing

    • Alternatively, IT support itself could be doing the same

  • How would you solve these problems?



  1. Simple Caesar cipher:

Chess is a two-player board game played on a chessboard, a checkered gameboard with 64 squares arranged in an eight-by-eight grid. Chess is played by millions of people worldwide, both amateurs and professionals. Each player begins the game with 16 pieces: one king, one queen, two rooks, two knights, two bishops, and eight pawns. Each of the six piece types moves differently. The most powerful piece is the queen and the least powerful piece is the pawn. The objective is to 'checkmate' the opponent's king by placing it under an inescapable threat of capture. To this end, a player's pieces are used to attack and capture the opponent's pieces, while supporting their own. In addition to checkmate, the game can be won by voluntary resignation by the opponent, which typically occurs when too much material is lost, or if checkmate appears unavoidable. A game may also result in a draw in several ways. Chess is believed to have originated in India, some time before the 7th century; the Indian game of chaturanga is also the likely ancestor of xiangqi, janggi and shogi. The pieces took on their current powers in Spain in the late 15th century; the rules were finally standardized in the 19th century. The first generally recognized World Chess Champion, Wilhelm Steinitz, claimed his title in 1886. Since 1948, the World Championship has been controlled by FIDE, the game's international governing body; the current World Champion is the Norwegian Magnus Carlsen. FIDE also organizes the Women's World Championship, the World Junior Championship, the World Senior Championship, the Blitz and Rapid World Championships and the Chess Olympiad, a popular competition among teams from different nations. There is also a Correspondence Chess World Championship and a World Computer Chess Championship. Online chess has opened amateur and professional competition to a wide and varied group of players. There are also many chess variants, with different rules, different pieces, and different boards.
Directory: wp-content -> uploads -> 2016
2016 -> 2017 afoCo Landmark Scholarship Program
2016 -> Instructions for the Preparation of Camera-Ready Contributions to the Conference Proceedings
2016 -> Step student Scholarships for Year 10-13
2016 -> The united church of canada
2016 -> Idan raichel biography – May 2016 Brief Producer, keyboardist, Lyricist, composer and Performer Idan Raichel
2016 -> An introduction to centre’s interventions expanding access to justice
2016 -> Sanchar Shakti
2016 -> The Autobiography of Elder Joseph Bates
2016 -> The Great Heat and the Rhode Island Deep Water Bay Scallop (Argopecten irradians) Fishery 1875-1905
2016 -> Diversifying Municipal Revenue in Connecticut Report Prepared for the Connecticut Tax Study Panel Presentation November 17, 2015 David L. Sjoquist Professor of Economics Andrew Young School of Policy Studies Georgia State University Atlanta


Share with your friends:


The database is protected by copyright ©ininet.org 2019
send message

    Main page