# Bugs in list combinations

Roman Chijner shared this question 1 year ago

Bugs in list combinations

Hi, Happy New Year everyone!!!!

e.g.

lA = {{10, 20, 30}, {100, 200, 300}, {-10, -20, -30}}

lB = {-10, 5, 0}

m04a2 = sqrt(Zip(Sum(a - lB)², a, lA))-? Bugs

workaround → m04b2 = sqrt(Zip(Sum({0, 0, 0} + (a - lB)²), a, lA))is Ok

m06 = Zip((a - lB) / sqrt(Sum({0, 0, 0} + (a - lB)²)), a, lA)

the same

m07 = Zip((a - lB) / sqrt(Sum({0, 0, 0} + (a - lB)²)), a, lA)

but various results. See attached files

1

P.S. Further in the ro1 r02 lists is strange too. How in Zip to exclude e.g. fd string?

1

Hi, try something like :

```Zip(sqrt(sum((a - lB)²)), a, lA)
Zip((a-lB)/sqrt(sum((a - lB)²)), a, lA)
```

1

Agree,

but m04a1 = Zip (Sum (a - lB) ², a, lA) _?

1

Zip(Sum((a-lB)^2),a,lA)

1

Thanks, it is logical to arrange the order of operations with brackets!

m06 and m07- Incorrectly displayed?

r01 and r02 bei fd=3?

How I can (in this situation) cut an element in Zip? In Sequence I can do it with Command If.

In a simple case, this is allowed: L_3 = Zip(If(j > 2 ∧ j < 5 ∨ j ≟ 10, 2^j), j, -5…12)

1

do you want r01 = Zip(If(Sum((a - lB1)²) > 0, (a - lB1) / sqrt(Sum((a - lB1)²)), a - lB1), a, lA) ?

or

r01 = KeepIf(Sum(P²) ≠ 0, P, Zip(If(Sum((a - lB1)²) > 0, (a - lB1) / sqrt(Sum((a - lB1)²)), a - lB1), a, lA))

1

Thanks. The second option!

You can get it in advance to exclude the necessary line p from the source list:

Join({First(lA, p - 1), Last(lA, Length(lA) - p)})

Many questions. See attached file

1. Incorrectly displaying

2. I took different options for the formation of the lists, it is difficult to understand the Zip in these cases.

1

En algún momento ha habido un problema con los nombres de las variables. En un archivo tan grande no me es posible suponer cuál pudo ser el problema. Pero se resuelve escribiendo las definiciones con otros términos, por ejemplo intenta

r01a = Zip((P - lB1) / sqrt(Sum((P - lB1)²)), P, lA) y mira los nuevos valores

aún así los valores mostrados con b=false no son correctos

creo que habrá un bug

en algunos casos zip(...........,a,list) substituye a por el último y solo el último elemento de la lista

para una simple ilustración del problema ver el adjunto

1

En el adjunto del archivo anterior selecciona/deselecciona symbolic para N

1

If I understand Google translation correctly: You have a Incorrectly displaying too!!!

In my examples, I do not understand the logic of the Zip command... There is not only Incorrectly displaying

1

the problem is only displaying Latex. See this values

logic of zip is clear for me but my poor english does not let me to explain each command

by the way, you can not use ? in comparison because ==? says false ever and !=? says true ever; you can use isdefined() instead in some cases