יום ראשון, 11 במרץ 2012

Chapters 7 and 8

-7.2
1.ok
2.parallel circuit...
3.no idea
4.ok.
5.A and B
6.Not A and B
7.Series of all 3.
8.huh?
9.A and B or Not A and B
10.ok
11.????
12.A and B and the A or B

-7.3
1.I was nervous when I found myself a little lost on this part of the chapter, but by the looks of other people's blogging, I'm not the only one. It seems not as important as the other stuff I've learnt so far.

-8.2
1.1000
2.30
3.2205
4.2^10
5.2^10?
6.10!+1
7.16^3
8.5!/2

-8.3
1.9*8*7
2.26!/21!
3.30!/25!+36!/31!
4.8!/2?
5.8!/2
6.12!/60 pages

-8.4
1.12!/2
2.120
3.1260
4.8?
5.5!
6.Not sure

-8.5
1.help
2.help again
3.40!/5!?
4.
def nChooseK(n, k):
 total = 1
 while (k>0):
  total*=(n/k)
   n--
   k--
  return total
5.?
6.? again.
7.not sure
8.n/x?
9.say what?
-I need help with what formulas to use when.

-8.6
1.20
2.6, im doing this all one by one, not sure how to do the simple way...
3. infinite
4.

Chapters 5 and 6

Chapter 5 Exercises

-5.2
1.18
2.10(a+b)-(a+b)=9a
3.don't get it
4.120,220
5.16,60
6.156
7.2222
8.113
9.220,112
10.ends with 2
11.uhhh

-5.3
1.127, 65535
2. 1001000010101011
3.2EB
4.170302
5.0b101110000
6.
def countBits(n)
 count =0
 n=bin(n)
 while (n!=0)
  if (n%2==1):
   count++
  n//=2
 return count
7.argh..

-5.4
1.-1329
2.error, too many bytes
3.rounding error
4.4211
5.16, 5
6.is it 7?

-6.2
1.I don't do
2.I did my homework and went to see a movie
3.either here or there
4.not P or Q
5.ok
6.ok.
7.pretty straightforward
8.P and not Q

-6.3
1.umm, okay.
2.okay
3.okay
4.okay...
5.Pretty sure I did this right, never been good with Sudoku
6.37
7.all true qs are true ps but not vise versa
8.Isn't it the same?
9.Kind of a waste of time

-6.4
1.return (n>0 and n%2==0)
2.x<-1 or x>1
3.b
4.such a waste of time
5.
def isLeapYear(n):
 if (n%400)
  return True
 elif (n%100)
  return False
 elif (n%4)
  return True
 else
  return False
6.
def isPrime (n):
 x=0
 while (x<=1000)
  if isPrime(x)
   Print x
   x++
  else x++
7.if (x and not s) or (s and not x)
8.ch in range(0,9)
9.negatives

Black Diamonds, wow.