Ask Your Question

Alain Ngalani's profile - activity

2024-03-28 07:03:16 +0200 received badge  Notable Question (source)
2023-06-21 14:00:27 +0200 received badge  Popular Question (source)
2023-01-28 14:17:44 +0200 received badge  Famous Question (source)
2022-10-15 13:41:59 +0200 received badge  Notable Question (source)
2022-10-15 13:41:59 +0200 received badge  Popular Question (source)
2022-06-15 19:09:21 +0200 received badge  Notable Question (source)
2022-06-15 19:09:21 +0200 received badge  Popular Question (source)
2021-12-16 11:44:19 +0200 received badge  Famous Question (source)
2021-10-25 23:08:12 +0200 received badge  Notable Question (source)
2021-04-18 18:19:39 +0200 commented answer Running a for cycle in parallel

I said that the function is not fit for my case becasue the set I need to check is very big, like 100 billion vectors o

2021-04-18 18:18:04 +0200 commented answer Running a for cycle in parallel

I said that the function is not fit for my case becasue the set I need to check is very big, like 18 million vectors of

2021-04-18 18:14:59 +0200 edited question Running a for cycle in parallel

Running a for cycle in parallel I have an algorithm that I need to speed up. I would like to parallelize computations

2021-04-18 17:57:43 +0200 edited question Running a for cycle in parallel

Running a for cycle in parallel I have an algorithm that I need to speed up. I would like to parallelize computations

2021-04-18 17:56:27 +0200 commented answer Running a for cycle in parallel

I can give you both a quick explanation of the two functions and the whole code: QUICK: -let v=(1,2,3) and w=(a,b), the

2021-04-18 17:47:18 +0200 commented answer Running a for cycle in parallel

I can give you both a quick explanation of the two functions and the whole code: QUICK: -let v=(1,2,3) and w=(a,b), the

2021-04-18 17:47:04 +0200 commented answer Running a for cycle in parallel

I can give you both a quick explanation of the two functions and the whole code: QUICK: -let v=(1,2,3) and w=(a,b), the

2021-04-18 17:46:46 +0200 commented answer Running a for cycle in parallel

I can give you both a quick explanation of the two functions and the whole code: QUICK: -let v=(1,2,3) and w=(a,b), the

2021-04-18 17:41:39 +0200 commented question Running a for cycle in parallel

Because all the operations in this key passage are independent (I need to check if any given element has a property), th

2021-04-17 20:20:49 +0200 received badge  Popular Question (source)
2021-04-17 19:21:14 +0200 asked a question Running a for cycle in parallel

Running a for cycle in parallel I have an algorithm that I need to speed up. I would like to parallelize computations

2021-03-01 17:47:05 +0200 marked best answer Modify a set and removing elements

I'm trying to modify a set but I'm having some problems doing so (I hope the code her è behaves the same as the one I have at home, at the moment I don't have access to the algorithms creating the specific set)

N=[[(0,0,1)],[(0,1,0)],[(0,1,1)],[(1,0,0)],[(1,0,1)],[(0,1,0)],[(1,1,1)]]

For a in N:
     N.remove(a)
     a.append(1)
     N.append(a)

This creates problems given how it doesn't remove all the elements and doesn't modify all of them

I kinda solved by introducing another set as

V=copy(N)

 For a in N:
     V.remove(a)
     a.append(1)
     V.append(a)

Now V behaves well, so I have two questions (plus a bonus one) :

Why does the first method create problems?

Using the second method I would like (the target algorithm does this for a set of a so I need the result to pass through the same process given that I need to add other elements to every eleemnt/set) at the end to set N as equal to V but neither using N=V, N=copy(V) nor N=[] and then appending all the elemts seems to work.

Is there a better way to do what I want to do? So a better way to take elements of a set and obatain another set whose elements are the starting ones modified by adding elements from another set? E. G. starting from A=[[1], [2]] , B=[a, b] obtain A=[[1,a], [1,b], [2,a],[2,b]]

2021-03-01 17:46:05 +0200 marked best answer Sets depending on a variable

I'm working on an algorithm that takes as impit a set and works accordingly to the set cardinality. In it I would like to define several sets with different properties in a way similar to this

For n in len(S) : Kn=stuff

However we all know the above will create a single set called Kn and work on it whilst I would like to have a set for each n, how can I do it?

This sets will be the base for several other sub algorithm so I need them to extually be defined, it's not enough to have them exist inside a given cycle as I think I should be able to do

2021-02-28 14:16:34 +0200 commented answer Updating Sage to python 3.8 or 3.9

I tried reinstalling it and even download again. I also tried building from source but I'unabke to, I try typing the com

2021-02-28 14:12:54 +0200 commented answer Updating Sage to python 3.8 or 3.9

The names are windows installer 0.6.2, etc... Do you have a guide to building from scratch

2021-02-27 14:40:31 +0200 commented answer Updating Sage to python 3.8 or 3.9

It doesn't seem to work, I removed every version (and checked by console that there was indeed none), then installed a new version (3.8.8.) but still nothing

2021-02-26 19:06:29 +0200 commented answer Updating Sage to python 3.8 or 3.9

I tried with 6.2 (sage 9.2), 6.1 (sage 9.2) and 6 (sage 9). No difference but in the fact that installing sage 9 it comes with Python 3.7.3 so even older

2021-02-26 17:10:04 +0200 commented answer Updating Sage to python 3.8 or 3.9

I compiled form binary

2021-02-26 17:03:59 +0200 commented answer Updating Sage to python 3.8 or 3.9

The fact that a given code works in sageCell but not on the version of sage I've in my pc.

Also I have both Python 3.8.8 and 3.9.something on my system but still it uses 3.7.7

2021-02-26 16:29:04 +0200 asked a question Updating Sage to python 3.8 or 3.9

I'm running an alogorithm that seems to work in sagecell but doesn't work in my version of Sage.

I think that maybe this has to do with the fact my version of Sage uses Python 3.7.7, in the last 2 days I tried everything I could to upgrade the Python version but nothing seems to work.

Also I find quite odd that it installs Python 3.7.7 given how on the release notes of Sage 9.2 it states that the program comes with its own copy of python 3.8.5.

Do you know how can I solve?

2021-02-26 14:34:27 +0200 commented answer Finite sums and multiplication

Ok, nice. I'm happy I was wrong

2021-02-26 14:34:08 +0200 received badge  Supporter (source)
2021-02-25 14:38:56 +0200 asked a question Finite sums and multiplication

Am I right in assuming that Sage has no meaningful way to translate mathematical notation as " for i in I, take the product of c_i" , " for i in I, take the sum of a_i", " for i in I, take the cartesian product of the sets B_i " ?

If this is true isn't this a very big problem of a language that's supposed to be about mathematics?

2021-02-25 13:14:30 +0200 commented answer For cycles over n-uples

Apart from this problem your solution seems to work, in particular this is closer to waht I'm planning to do in the end and it does what it should

2021-02-24 17:15:56 +0200 commented answer For cycles over n-uples

3.7.7. Is there a way to update?

2021-02-24 16:49:24 +0200 commented answer For cycles over n-uples

https://imgur.com/a/KQfYvHH 9.2 this is a screenshot of everything

2021-02-24 16:19:39 +0200 marked best answer For cycles over n-uples

Is it possible to run a for cyle over an n-uple? I give an example with a code that doesn't work as intended: I want to write, for A=[1,2] B=[3,4], something like

  for a,b in A,B:
     print(a,b)

and obtain the following

    1,3
    1,4
    1,5
    1,6

I know in this case I could use

 for a in A:
     for b in B:
          print(a,b)

but in the code I'm writing this is not ideal, basically beacuse I want to do stuff with each of the vectors in the following way

c=[]
A=[[],...[]]
n=len(A)
for x in range(n):
  for a in A[x]:
      f=function
      c.append(f(a))
      do stuff with c, reset c to [] in order to repete with different elements

and in this case is harder to have c made the way I want it to be made.

I hope what I mean is clear

EDIT: To be more precise what I have is a set C[[C1], [Cn]] where n depends on the imput and the CI are themself sets.

I want to build (and check a given property) vectors of the type [c1, f1(c1), f1^2(c1),...f1^(e1)(c1),.....fn^(en)(cn)] for ci in CI

Trying to do it in the "traditional way" has the problem of storing the half built vectors. Let's suppose I've built the vector until [c1, f1(c1), f1^2(c1),...f1^(e1)(c1),.....f(n-1)^(e(n-1))(c(n-1))] now I can add the last bunch of components and check if the property is satisfied, but if I want to check the same with a different final bunch (corresponding to a different cn) I have to have stored [c1, f1(c1), f1^2(c1),...f1^(e1)(c1),.....f(n-1)^(e(n-1))(c(n-1))], go back to it and retry.

On the other side if we take a more "mathematical theoretic" approach I don't have this problem where for "mathematical approach" I mean taking (c1,...c_n) in C1 X .... X CN and then just build the final vector from this.