From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Finding repetitions of 8-tuples Date: Sun, 1 Jan 2023 23:39:36 +0700 Message-ID: References: <1399831366.706043.1672506045023@ichabod.co-bxl> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26641"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Hans Lonsdale , Help Gnu Emacs To: Arthur Miller Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 01 17:41:08 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pC1OU-0006lT-TE for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 01 Jan 2023 17:41:06 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pC1NX-0002dd-Mt; Sun, 01 Jan 2023 11:40:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pC1NO-0002co-O6 for help-gnu-emacs@gnu.org; Sun, 01 Jan 2023 11:39:59 -0500 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pC1NF-0002wa-Qs for help-gnu-emacs@gnu.org; Sun, 01 Jan 2023 11:39:51 -0500 Original-Received: by mail-wr1-x42f.google.com with SMTP id d17so4503621wrs.2 for ; Sun, 01 Jan 2023 08:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=8XNJdN35+Q1YnMKQDNWmkLQ9b0FfkJUqHq6oYW1z9Jo=; b=gxH1UPPV9oa+m4iTNYHg4tZQY5t3UvPriCFjJrOcc5nEvFbGsLYFDCp+SC3T3GaX4r SmVsATUOZf1mzkQZQT6gRg43W9xv9fbO6GpNIbfFJjXNJmmzcAeoc66I1E+lTBoR8Mjk dX65fTBE0LwlP89OgVNKviYj6sQrB353N+3/XOI5VezIHlc4LXDchQ8NvoOZdOCgiV9g VZ/Ac1KD5PtlSNv2MxTJsdd1T6lvNN5z7wnXvqeSJp6ff1k/hsmSZU4LCz7YolWGYbuO 3xBNSH30Fr+TircVP54V1J5c+NyZTduPKbwm7T0vXeUGf9RS6IE1atgviNAoVb81eVdH fr+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8XNJdN35+Q1YnMKQDNWmkLQ9b0FfkJUqHq6oYW1z9Jo=; b=dUycwRX2nmozaQOmSYgBMcaiuar78XTw8Fa+OzM2Bjm8AsCDpjBmW+w0varqTqFTk2 Tj+NUCUAcLvlS8Ml3yaUP737NgM/S3A8SmTunqvwjCu96SK+wv/1GAoeMkzjGQsbkusf NPWVa5BF7z1t7AckgFsaDLlm1OWeXL9ABt/atoSfcbr851iuNFTtFwHbEuzzg4BVSbi5 3A/gnbWYsrgyvXMtML/IzE4X0o0uPTSLbWzbtJk4KZoZMntea1TU9rpRzdvDWIpTZm7o jbjd6IUySDN1Da2HbAo+rWE4tuq7pwumWa6EzxEVndSMWn0yvFX5YRJQcaQaFqjnrXDc C5Lw== X-Gm-Message-State: AFqh2kqdwPSpOlgaHY1Fnf9wf9jd7EUCjViQ4tED+FTbJt/2lG/MAOkm b0k42G9hFz06TFug4xTP79clhhq7p0pt562cC9w= X-Google-Smtp-Source: AMrXdXt3IJbtjKPVERFwNtUFfr6h9yLiMvL4+Eu9BfZzi9BBur7qtx/J2w2lQQ7RdMGeYn+rMqueIMJEnzHRrVhje7c= X-Received: by 2002:adf:fb8e:0:b0:242:1d01:16fd with SMTP id a14-20020adffb8e000000b002421d0116fdmr747559wrr.682.1672591187485; Sun, 01 Jan 2023 08:39:47 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=yurivkhan@gmail.com; helo=mail-wr1-x42f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142085 Archived-At: On Sun, 1 Jan 2023 at 22:19, Arthur Miller wrote: > > I have 16 collections of 8 numbers > > > > (11 12 11 44 11 12 11 23) > > (12 21 11 44 11 12 11 23) > > and so on > > > > I want to find whether there are repetitions of each 8-tuple. > > The order in which the numbers occur is not important. > > Have you looked at "lists as sets" chapter in the manual? This line of thought leads nowhere because treating a list as a set ignores its duplicate counts. I take it that in the OP=E2=80=99s problem statement (1 1 1 1 1 2 2 2) is to be considered distinct from (1 1 1 1 2 2 2 2), but, treated as sets, they are both equivalent to (1 2). The original problem calls for multisets =E2=80=94 containers where the order i= s not significant but the counts of duplicates are. Sorting each list and comparing the result of sorting, as suggested in another reply, is going to be a better approach. Alternatively, one might hash each element and xor the hashes together. However, this carries collision risk inherent in hash-based solutions =E2=80=94 if hashes are different, the multisets are different, b= ut if the hashes are equal, this does not guarantee the equality of multisets.