René's URL Explorer Experiment


Title: Duplicate Permutations Unaddressed · Issue #56 · KxSystems/docs · GitHub

Open Graph Title: Duplicate Permutations Unaddressed · Issue #56 · KxSystems/docs

X Title: Duplicate Permutations Unaddressed · Issue #56 · KxSystems/docs

Description: Issue In several locations across code.kx.com we deal with finding all permutations. e.x. https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute https://code.kx.com/phrases/math/#permutations In both of these cases, I find ...

Open Graph Description: Issue In several locations across code.kx.com we deal with finding all permutations. e.x. https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute https://code.kx.com/phrases/math/#perm...

X Description: Issue In several locations across code.kx.com we deal with finding all permutations. e.x. https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute https://code.kx.com/phrases/math/#perm...

Opengraph URL: https://github.com/KxSystems/docs/issues/56

X: @github

direct link

Domain: patch-diff.githubusercontent.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Duplicate Permutations Unaddressed","articleBody":"# Issue\r\nIn several locations across code.kx.com we deal with finding all permutations. e.x.\r\n- https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute\r\n- https://code.kx.com/phrases/math/#permutations\r\n\r\nIn both of these cases, I find that duplicate permutations are just completely unaddressed. If we are dealing with a set, naturally there will be no problem with duplicates. But the phrasebook does not clearly specify that we are dealing with sets, and the reading room puzzle goes further to specify our input is a string (clearly not a set). Furthermore, even if we assume that we are dealing with permutations of a set, we should ensure that the official solutions we provide handle these in a standardized and expected manner. \r\n\r\n![](https://user-images.githubusercontent.com/19809631/147801929-0721037e-2515-4017-9f67-1bbefb695f05.png)\r\n\r\nClearly this is not the case. \r\n\r\n# Solutions \r\nWe should either: \r\n1. Clarify that the solutions provided only deal with unique elements, and have undefined behaviour otherwise\r\n2. Standardize the solutions to remove all duplicates\r\n3. Standardize the solutions to enumerate all permutations, regardless of duplicates\r\n\r\nWe can also do any combination of these (e.x. solution (1) for phrasebook and (2) for the reading room problem).\r\n\r\n# My Contribution\r\nI believe solution 2 is the best option. A list of permutations with duplicates seems redundant and unnecessary. You might as well `distinct` the output, in which case we should do this in the solutions provided. I don't know if applying `distinct` is necessarily the best solution here, in fact I have little experience with q, but it seems the most straightforward solution.\r\n\r\n## Phrasebook\r\n- Before: `{(1 0#x){raze(1 rotate)scan'x,'y}/x}`\r\n- After: `{(1 0#x){distinct raze(1 rotate)scan'x,'y}/x}`\r\n\r\n## Reading room cats cradle solution 1\r\nThis solution is actually incomplete and incorrect which is a separate issue of its own that caused this entire investigation. I have done the best I can to fix the solution and will provide it as a PR after discussion of this ticket.\r\n- Before: `{x {flip[y]where x=sum y}[s;] s vs til\"j\"$s xexp s:count x}`, incorrect\r\n- After: `{distinct x @ b where all each (til c) in/:b:flip c vs til \"j\"$c xexp c:count x}`\r\n\r\n## Reading room cats cradle solution 2\r\n- Before: `{(1 0#x) {raze({raze reverse 0 1 _ x}\\)each x,'y}/ x}`, strongly based off the phrasebook solution\r\n- After: `{(1 0#x) {distinct raze({raze reverse 0 1 _ x}\\)each x,'y}/ x}`","author":{"url":"https://github.com/Scowluga","@type":"Person","name":"Scowluga"},"datePublished":"2021-12-31T04:02:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/56/docs/issues/56"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cd2187fe-ea82-9ced-95b9-7f227fd5c203
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEA1E:AE4D:25A31D2:307D959:698C1326
html-safe-noncea859704e4b134adfe4554f1d23a6c000f2f359b81c871707ef3df5c6b3dfb80a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTFFOkFFNEQ6MjVBMzFEMjozMDdEOTU5OjY5OEMxMzI2IiwidmlzaXRvcl9pZCI6IjQ4MzE1MjU2ODY0NzU0OTQxODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac6e9cde48922c504a297613deaa0b414bdde4fc3907b75a9d0d3dcc17767805ae
hovercard-subject-tagissue:1091404634
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/KxSystems/docs/56/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a891bbea31e49233d46fa30609df370194df6bef58e59bca3c98c9f400531423/KxSystems/docs/issues/56
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a891bbea31e49233d46fa30609df370194df6bef58e59bca3c98c9f400531423/KxSystems/docs/issues/56
og:image:altIssue In several locations across code.kx.com we deal with finding all permutations. e.x. https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute https://code.kx.com/phrases/math/#perm...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameScowluga
hostnamegithub.com
expected-hostnamegithub.com
None640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4
turbo-cache-controlno-preview
go-importgithub.com/KxSystems/docs git https://github.com/KxSystems/docs.git
octolytics-dimension-user_id11446750
octolytics-dimension-user_loginKxSystems
octolytics-dimension-repository_id175059605
octolytics-dimension-repository_nwoKxSystems/docs
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id175059605
octolytics-dimension-repository_network_root_nwoKxSystems/docs
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release3d444f0a47beeeac94cddbb51c91ab408befe8d4
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/KxSystems/docs/issues/56#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FKxSystems%2Fdocs%2Fissues%2F56
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2FKxSystems%2Fdocs%2Fissues%2F56
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=KxSystems%2Fdocs
Reloadhttps://patch-diff.githubusercontent.com/KxSystems/docs/issues/56
Reloadhttps://patch-diff.githubusercontent.com/KxSystems/docs/issues/56
Reloadhttps://patch-diff.githubusercontent.com/KxSystems/docs/issues/56
KxSystems https://patch-diff.githubusercontent.com/KxSystems
docshttps://patch-diff.githubusercontent.com/KxSystems/docs
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2FKxSystems%2Fdocs
Fork 65 https://patch-diff.githubusercontent.com/login?return_to=%2FKxSystems%2Fdocs
Star 79 https://patch-diff.githubusercontent.com/login?return_to=%2FKxSystems%2Fdocs
Code https://patch-diff.githubusercontent.com/KxSystems/docs
Issues 1 https://patch-diff.githubusercontent.com/KxSystems/docs/issues
Pull requests 0 https://patch-diff.githubusercontent.com/KxSystems/docs/pulls
Actions https://patch-diff.githubusercontent.com/KxSystems/docs/actions
Projects 0 https://patch-diff.githubusercontent.com/KxSystems/docs/projects
Security 0 https://patch-diff.githubusercontent.com/KxSystems/docs/security
Insights https://patch-diff.githubusercontent.com/KxSystems/docs/pulse
Code https://patch-diff.githubusercontent.com/KxSystems/docs
Issues https://patch-diff.githubusercontent.com/KxSystems/docs/issues
Pull requests https://patch-diff.githubusercontent.com/KxSystems/docs/pulls
Actions https://patch-diff.githubusercontent.com/KxSystems/docs/actions
Projects https://patch-diff.githubusercontent.com/KxSystems/docs/projects
Security https://patch-diff.githubusercontent.com/KxSystems/docs/security
Insights https://patch-diff.githubusercontent.com/KxSystems/docs/pulse
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/KxSystems/docs/issues/56
New issuehttps://patch-diff.githubusercontent.com/login?return_to=https://github.com/KxSystems/docs/issues/56
Duplicate Permutations Unaddressedhttps://patch-diff.githubusercontent.com/KxSystems/docs/issues/56#top
https://github.com/Scowluga
https://github.com/Scowluga
Scowlugahttps://github.com/Scowluga
on Dec 31, 2021https://github.com/KxSystems/docs/issues/56#issue-1091404634
https://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permutehttps://code.kx.com/q/learn/reading/strings/#its-more-fun-to-permute
https://code.kx.com/phrases/math/#permutationshttps://code.kx.com/phrases/math/#permutations
https://user-images.githubusercontent.com/19809631/147801929-0721037e-2515-4017-9f67-1bbefb695f05.png
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.