Timeline for Multiplying elements of two lists in all possible orders
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 7, 2023 at 17:14 | history | edited | user64494 | CC BY-SA 4.0 |
edited title
|
Nov 7, 2023 at 14:45 | vote | accept | Fatima RAZA | ||
Nov 7, 2023 at 0:14 | history | edited | march | CC BY-SA 4.0 |
added 28 characters in body
|
Nov 7, 2023 at 0:10 | answer | added | march | timeline score: 2 | |
Nov 6, 2023 at 21:33 | answer | added | lericr | timeline score: 2 | |
Nov 6, 2023 at 19:31 | history | edited | user64494 | CC BY-SA 4.0 |
edited title
|
Nov 6, 2023 at 17:58 | comment | added | ydd |
This is because Intersection only shows unique elements that occur in both lists, so if each list shares two 2s, it will only show one 2. I just used that with the symbolic U1 and U2 to show that what your looking for is a subset of all of the products between the two, but I'm still unsure what the criterion is for selecting the elements you want.
|
|
Nov 6, 2023 at 17:47 | comment | added | Fatima RAZA | and even if I am defining my UU as UU = {2, 1, 6, 4, 3, 2, 24, 18, 16, 12, 12, 9, 8, 6} manually (in actual I want to get this list as a result) then sorting intersection according to your method as Sort@Intersection[UU, allProducts] === Sort@UU I am getting False | |
Nov 6, 2023 at 17:43 | comment | added | Fatima RAZA | When I define my U1 = {2, 3, 4}, and U2 = {1, 2, 3} and getting all products by using allProducts = Times @@ # & /@ Subsets[Join[U1, U2], {1, 3}] it is resulting in one list as {2, 3, 4, 1, 2, 3, 6, 8, 2, 4, 6, 12, 3, 6, 9, 4, 8, 12, 2, 3, 6, 24, 6, 12, 18, 8, 16, 24, 4, 6, 12, 12, 24, 36, 6, 9, 18, 8, 12, 24, 6} | |
Nov 6, 2023 at 17:29 | comment | added | Fatima RAZA | but in this case I have to manually define UU. i want to get UU as a result of the multiplication. | |
Nov 6, 2023 at 17:21 | comment | added | ydd |
I still don't understand this pattern, but FWIW UU is definitely a subset of MapApply[Times, Subsets[all, {1, 3}]] . $$ $$ allProducts =MapApply[Times, Subsets[all, {1, 3}]]; Sort@Intersection[UU, allProducts] === Sort@UU (*True*) I am still struggling to see what property links all the elements in UU together though. There has to be some way to select the right products from allProducts if they share some kind of property.
|
|
Nov 6, 2023 at 17:02 | history | edited | Fatima RAZA | CC BY-SA 4.0 |
added 556 characters in body
|
Nov 6, 2023 at 16:59 | comment | added | Fatima RAZA | sure, this kind of pattern could be observed using NCExpand. let me share It in my post. | |
Nov 6, 2023 at 16:58 | history | edited | march | CC BY-SA 4.0 |
added 57 characters in body
|
Nov 6, 2023 at 16:57 | comment | added | march | I think it would here to explain what the pattern/math actually is. Including an example is great, but I can't discern from the example what the actual structure is, and so I can't figure out how to automate it. Can you update your post to include information about the logic behind the pattern? | |
S Nov 6, 2023 at 16:50 | review | First questions | |||
Nov 6, 2023 at 16:57 | |||||
S Nov 6, 2023 at 16:50 | history | asked | Fatima RAZA | CC BY-SA 4.0 |