The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

diegonc (5) [Avatar] Offline
#1
In this examples of page 32
===========
a = [ 0, 1, 0, 1]
b = [ 1, 0, 1, 0]
c = [ 0, 1, 1, 0]
d = [.5, 0,.5, 0]
e = [-1, 1, 0, 0]

w_sum(a,b) = 0
w_sum(b,c) = 1
w_sum(b,d) = 1
w_sum(c,c) = 2
w_sum(d,d) = .5
w_sum(c,e) = 0
=============

the weighted sum of (c,e) is wrong.

The vector e should be [0, 1, -1, 0] or its negated version
to be consistent with the explanation that follows.
raulfragoso (1) [Avatar] Offline
#2
I just noticed that error too.
446170 (1) [Avatar] Offline
#3
Also my interpreter was complaining about line:

for i in range(a):  //TypeError: 'list' object cannot be interpreted as an integer



Python 3

fixed with:


for i in range(0, len(a)):