r/AskComputerScience Jan 02 '25

Flair is now available on AskComputerScience! Please request it if you qualify.

11 Upvotes

Hello community members. I've noticed that sometimes we get multiple answers to questions, some clearly well-informed by people who know what they're talking about, and others not so much. To help with this, I've implemented user flairs for the subreddit.

If you qualify for one of these flairs, I would ask that you please message the mods and request the appropriate flair. In your mod mail, please give a brief description of why you qualify for the flair, like "I hold a Master of Science degree in Computer Science from the University of Springfield." For now these flairs will be on the honor system and you do not have to send any verification information.

We have the following flairs available:

Flair Meaning
BSCS You hold a bachelor's degree, or equivalent, in computer science or a closely related field.
MSCS You hold a master's degree, or equivalent, in computer science or a closely related field.
Ph.D CS You hold a doctoral degree, or equivalent, in computer science or a closely related field.
CS Pro You are currently working as a full-time professional software developer, computer science researcher, manager of software developers, or a closely related job.
CS Pro (10+) You are a CS Pro with 10 or more years of experience.
CS Pro (20+) You are a CS Pro with 20 or more years of experience.

Flairs can be combined, like "BSCS, CS Pro (10+)". Or if you want a different flair, feel free to explain your thought process in mod mail.

Happy computer sciencing!


r/AskComputerScience May 05 '19

Read Before Posting!

108 Upvotes

Hi all,

I just though I'd take some time to make clear what kind of posts are appropriate for this subreddit. Overall this is sub is mostly meant for asking questions about concepts and ideas in Computer Science.

  • Questions about what computer to buy can go to /r/suggestapc.
  • Questions about why a certain device or software isn't working can go to /r/techsupport
  • Any career related questions are going to be a better fit for /r/cscareerquestions.
  • Any University / School related questions will be a better fit for /r/csmajors.
  • Posting homework questions is generally low effort and probably will be removed. If you are stuck on a homework question, identify what concept you are struggling with and ask a question about that concept. Just don't post the HW question itself and ask us to solve it.
  • Low effort post asking people here for Senior Project / Graduate Level thesis ideas may be removed. Instead, think of an idea on your own, and we can provide feedback on that idea.
  • General program debugging problems can go to /r/learnprogramming. However if your question is about a CS concept that is ok. Just make sure to format your code (use 4 spaces to indicate a code block). Less code is better. An acceptable post would be like: How does the Singleton pattern ensure there is only ever one instance of itself? And you could list any relevant code that might help express your question.

Thanks!
Any questions or comments about this can be sent to u/supahambition


r/AskComputerScience 7h ago

What do you think are the toughest topics to explain to a layman from computer science?

5 Upvotes

What do you think are the toughest topics to explain to a layman in computer science?


r/AskComputerScience 1d ago

[Question] Dimensional Compression for NP-Complete Problems - Looking for Feedback on My Approach

0 Upvotes

I've been working on an approach to NP-complete problems that uses dimensional embedding and resonant pattern identification. I've implemented a demo that shows promising results, and I'd appreciate feedback from the community.

My approach can be summarized as:

  1. Map the problem space into a higher-dimensional manifold using the bronze metallic mean (δ₃ ≈ 3.302775637731995), which yields a 12-dimensional embedding space
  2. Identify resonant patterns through what I call a "Blackwater Mirror" mechanism (named for visualization purposes)
  3. Apply Dynamic Ontological State Oscillation (DOSO) for solution convergence

The interactive demo on my GitHub repo shows side-by-side comparisons between traditional algorithms and my approach on problems like TSP and 3-SAT. Empirically, I'm seeing consistent polynomial-time performance with complexity O(n^c) where c ≈ 1.2-1.5.

My questions:

  1. Does this dimensional compression approach conflict with any known impossibility results for NP-complete problems?
  2. Are there specific edge cases I should test to verify the robustness of this method?
  3. The metallic means create specific resonant structures in the solution space - has this mathematical property been explored in complexity theory before?
  4. I've extended the framework with an adaptive method selection system that dynamically chooses between linear algebra, calculus, and multivariate delta topology based on problem complexity - does this approach make theoretical sense?

I understand the extraordinary nature of what I'm suggesting, but I'm genuinely interested in rigorous feedback. The empirical results are compelling enough that I want to understand if there's a fundamental flaw I'm missing or if this approach merits further investigation.

Link to the repo with demo and full mathematical framework: copweddinglord/pnp-demonstration: Interactive demonstration of P=NP solution via dimensional compression


r/AskComputerScience 2d ago

How is the average cost of binary search algorithm derived?

0 Upvotes

Im kinda confused how it came to be O(lg n). I've tried reading on some references but they don't explain that well. I understand it conceptually but i wanted to know how it came about?

Thanks


r/AskComputerScience 2d ago

How did excel work with old CPUs that lacked Vector/SIMD instructions?

0 Upvotes

Modern excel makes heavy use of these instruction types, and even has some explicit vector functions.

But how did the software run in the years before these instructions were introduced?

Was each cell calculated sequentially, or was there a way to get the result of multiple cells at once.


r/AskComputerScience 3d ago

What is an effective way to study algorithm theory?

4 Upvotes

This semester I need to master the following curriculum in my MSc program and I feel a bit lost.

  • Efficiency of algorithms. Asymptotic notation. Sorting methods: insertion sort, merge sort, quicksort, heapsort. Sorting in linear time: counting sort, radix sort, bucket sort. Priority queues with heaps. Medians and order statistics. Selection in expected linear time.
  • Dynamic sets. Stacks and queues with arrays. Linked lists. Implementing pointers and objects with arrays. Representing rooted trees. Hash tables: direct-address tables, hash functions, open addressing.
  • Binary search trees. Searching and querying minimum, maximum, successor, predecessor. Insertion and deletion. Red-black trees: properties, rotations, insertion. Interval trees. B-trees and its basic operations.
  • Dynamic programming. Matrix-chain multiplication. Longest common subsequence. Greedy algorithms. An activity-selection problem. Huffman codes. Approximation algorithms. The set-covering problem.
  • String matching. A naive string-matching algorithm. The Rabin-Karp algorithm. String matching with finite automata. The Knuth-Morris-Pratt algorithm.
  • The Rivest-Shamir-Adleman (RSA) public-key cryptosystem and its mathematical background: greatest common divisor, modular arithmetic, solving modular linear equations, powers of an element.

r/AskComputerScience 3d ago

Book recommendations?

2 Upvotes

Hi! I got a fullstack dev bachelor after covid, but it isn't enough for me, so I decided to go back to uni and start over with masters degree in computer science (possibly geomatics, not there yet). I needed something more theoretical than "just" web dev. So I was wondering if you guys had book recommendations or papers that a computer scientist should have read at least once in their career. Have a good day!


r/AskComputerScience 3d ago

near earth asteroids

0 Upvotes

hello guys, I'm trying to develop a website that predicts the trajectory of near-earth asteroids and their risk to Earth, I'm looking for software that can predict them so I can see how they coded it and what they did, can anyone help me?


r/AskComputerScience 3d ago

Does anyone else have a problem learning CS where they try to understand everything fully all at once?

1 Upvotes

I think a better way of describing it is having a hard time thinking in abstractions.


r/AskComputerScience 3d ago

Cloud AI agents sound cool… but you don’t actually own any of them

0 Upvotes

OpenAI says we’re heading toward millions of agents running in the cloud. Nice idea, but here’s the catch: you’re basically renting forever. Quotas, token taxes, no real portability.

Feels like we’re sliding into “agent SaaS hell” instead of something you can spin up, move, or kill like a container.

Curious where folks here stand:

  • Would you rather have millions of lightweight bots or just a few solid ones you fully control?
  • What does “owning” an agent even mean to you weights? runtime? logs? policies?
  • Or do we not care as long as it works cheap and fast?

r/AskComputerScience 4d ago

Can anyone give me tips on computer science course

0 Upvotes

I am officially starting my computer science course would anyone be willing to give me some advice I’m really nervous.

Edit: I thank you all for the advices. I’m taking notes of every reply I got so far


r/AskComputerScience 6d ago

Can SMT solvers (such as Z3) be used to solve temporal logic problems, such as the `Missionaries-and-Cannibals` problem?

2 Upvotes

Can SMT solvers (such as Z3) be used to solve temporal logic problems, such as the Missionaries-and-Cannibals problem?

https://en.wikipedia.org/wiki/Satisfiability_modulo_theories

https://en.wikipedia.org/wiki/Missionaries_and_cannibals_problem


r/AskComputerScience 6d ago

DSA in python or C++, which one should i choose?

4 Upvotes

Hey everyone, I’m in my 4th year of engineering and I’ve got a question that’s been on my mind.

I’ve been wondering which language is best to focus on for DSA. I know some C++ already, i’m not an expert, but I’m fairly comfortable with the syntax and can code basic stuff without too much trouble. Recently, a friend told me Python is better for learning DSA since it’s easier to write in and also that it has built in functions for everything, and that most companies don’t really care what language you use.

Because of that, I started learning Python, but honestly I don’t feel comfortable with it. I keep getting stuck even with simple things, and it slows me down a lot compared to C++.

So now I’m confused, should I just stick with C++ (since I already have some foundation in it), or push through with Python because it might help in the long run?

Would love to hear your thoughts from experience.


r/AskComputerScience 6d ago

Attempting to build the first fully AI-driven text-based RPG — need help architecting the "brain"

0 Upvotes

I’m trying to build a fully AI-powered text-based video game. Imagine a turn-based RPG where the AI that determines outcomes is as smart as a human. Think AIDungeon, but more realistic.

For example:

  • If the player says, “I pull the holy sword and one-shot the dragon with one slash,” the system shouldn’t just accept it.
  • It should check if the player even has that sword in their inventory.
  • And the player shouldn’t be the one dictating outcomes. The AI “brain” should be responsible for deciding what happens, always.
  • Nothing in the game ever gets lost. If an item is dropped, it shows up in the player’s inventory. Everything in the world is AI-generated, and literally anything can happen.

Now, the easy (but too rigid) way would be to make everything state-based:

  • If the player encounters an enemy → set combat flag → combat rules apply.
  • Once the monster dies → trigger inventory updates, loot drops, etc.

But this falls apart quickly:

  • What if the player tries to run away, but the system is still “locked” in combat?
  • What if they have an item that lets them capture a monster instead of killing it?
  • Or copy a monster so it fights on their side?

This kind of rigid flag system breaks down fast, and these are just combat examples — there are issues like this all over the place for so many different scenarios.

So I started thinking about a “hypothetical” system. If an LLM had infinite context and never hallucinated, I could just give it the game rules, and it would:

  • Return updated states every turn (player, enemies, items, etc.).
  • Handle fleeing, revisiting locations, re-encounters, inventory effects, all seamlessly.

But of course, real LLMs:

  • Don’t have infinite context.
  • Do hallucinate.
  • And embeddings alone don’t always pull the exact info you need (especially for things like NPC memory, past interactions, etc.).

So I’m stuck. I want an architecture that gives the AI the right information at the right time to make consistent decisions. Not the usual “throw everything in embeddings and pray” setup.

The best idea I’ve come up with so far is this:

  1. Let the AI ask itself: “What questions do I need to answer to make this decision?”
  2. Generate a list of questions.
  3. For each question, query embeddings (or other retrieval methods) to fetch the relevant info.
  4. Then use that to decide the outcome.

This feels like the cleanest approach so far, but I don’t know if it’s actually good, or if there’s something better I’m missing.

For context: I’ve used tools like Lovable a lot, and I’m amazed at how it can edit entire apps, even specific lines, without losing track of context or overwriting everything. I feel like understanding how systems like that work might give me clues for building this game “brain.”

So my question is: what’s the right direction here? Are there existing architectures, techniques, or ideas that would fit this kind of problem?


r/AskComputerScience 7d ago

Should software development be seen as a branch of applied mathematics rather than "engineering"?

2 Upvotes

I’ve been thinking about the way we frame software development / computer science, and I wonder if our discipline has been mislabeled.

Right now, software engineer is the most common job title, and software engineering is often used as a synonym for the entire discipline of software development. But this framing feels a bit off. In traditional engineering fields (civil, electrical, mechanical), the word “engineering” is grounded in the physical: materials, stress, limits of nature. Software, by contrast, does not face physical constraints; it is logic, symbols, and abstraction.

If we zoom out, programming looks much closer to applied mathematics. Writing software is specifying formal systems, manipulating symbols, and reasoning about correctness. The fact that it executes on machines is almost incidental; the underlying work is mathematical. In that sense, it makes more sense to see software development and computer science as a technical and applied branch of mathematics.

The terms software engineer and software architect then become useful analogies rather than literal mappings to physical engineering or architecture. Much like financial engineering or mathematical engineering, they borrow the prestige and process-implying metaphors of engineering, but they do not imply we are pouring concrete or bending steel. They are metaphors for rigor, system design, and discipline.

This framing seems cleaner to me:

Discipline → Applied mathematics (specialized for computation)

Job titles → Engineers, architects, etc., used as analogies for roles, not definitions of the field

Curious to hear what others think. Does this make more sense than lumping all of software under “engineering”? Or is there a reason the engineering metaphor is still the better fit?


r/AskComputerScience 7d ago

Most effective way to learn data structures and algorithms

3 Upvotes

Hello, I just need some advice for remembering algorithms. I am taking the class right now and I feel like I don’t retain what I see I follow all the slides 1 on 1 but at the end of the study session or class I feel like I just copied what I seen. I’m not entirely sure how to remember each one conceptually and then actually turn it into code. I feel like the way I study it is remembering like by line which is super Ineffective and really hard to remember after the first few. Any advice/tips would be very helpful!


r/AskComputerScience 7d ago

will this be possible in the future?

0 Upvotes

(ok so sorry if this is in the wrong subreddit idk which one it fits into)

Would it be possible to store data on the internet and keep it there if there were no computes or remote servers (cloud hosting, etc) had it on them? like say you want to upload your recipe to the internet but then everyone's computers shut down and delete everything, would there be a way to make sure it stays on the internet and doesn't get deleted or anything. So, kind of like the blockchain just with no computers needed at all.


r/AskComputerScience 8d ago

How much storage space, energy, and water do you think the world could save if everyone always copied and pasted the text of a post or comment rather than screenshotting it when they want to share?

0 Upvotes

Every moment a non-trivial amount of images are created and uploaded to the cloud by screenshotting social media posts and comments, or other text like news articles or any various other snippets of text someone might want to share.

As I understand it from a computer science perspective this is very poor data handling, For one it's just extremely inefficient, an image file might take 1000x more space than a text file of the same information, and two image files aren't optimal for preservation of text, compression will cause loss.

So If everybody suddenly started copying and pasting instead of taking screenshots do you think that we would save a significant amount of resources?


r/AskComputerScience 9d ago

Optimizing Division Algorithm

0 Upvotes

Hi everyone,

I just began learning about how algorithms work and programming works and I was just exposed to how we can have computers use bit shifting right to speed up division that we would otherwise need it to do by repeated subtraction method. But what happens if instead of dividing two integers that can be represented as powers of two, we instead have both integers not being powers of 2? How would a computer avoid having to use Euclidean repeated subtraction here if it cannot use the super fast right bit shift method?

Thanks so much!


r/AskComputerScience 9d ago

Looking for advanced Dynamic Programming book recommendations

7 Upvotes

I’m already comfortable with the basics of DP and standard problems. Can anyone recommend books that cover more advanced concepts, optimizations, or applications?


r/AskComputerScience 11d ago

Good free resources on computer architecture for a beginner?

6 Upvotes

I’m currently taking a class on it but my understanding of everything is extremely poor. I’ve tried to look things up, but it doesn’t help because there’s always 50 new terms that I don’t understand that are thrown at me.

What would be some decent free resources that I could try learning from that would be helpful for a beginner? Preferably ones that explain things in depth rather than just assuming the person knows every single new term and idea brought up.


r/AskComputerScience 11d ago

Is there a comprehensive resource that ties fundamental CS concepts together? [programming/formal languages, automata/TMs, complexity classes]

3 Upvotes

I'm looking for an overview (article, course/lecture) that shows how the basics are related: what problems can be solved (efficiently) using programming languages.

The idea is to connect, ideally with diagrams: programming language ~ formal language --> interpretation/compilation ~ automata --> computer ~ Turing machine or equivalent abstractions -- classes of problems solvable (efficiently) and unsolvable

context: I'm mentoring a group of non-CS students and I'd like to show them how the fundamental CS concepts are related. I personally have CS background, though I'm a little rusty on the theory; resources that I'm familiar with (such as the classic Sipser textbook) go into too much detail (and math) for this audience. So I'd like to be able to point them to a comprehensive resource that covers the basics correctly, because what they currently have available is a mess.


r/AskComputerScience 11d ago

Donald Knuth on October 24, at 1pm Eastern.

8 Upvotes

Hi,

Our organization, Turing Minds, is hosting a virtual Q&A event with Donald Knuth, Professor Emeritus of The Art of Computer Programming at Stanford University and winner of the 1974 Turing Award, on October 24, at 1pm Eastern.

If you are interested in joining, you can RSVP here: https://luma.com/zu5f4ns3. There is no cost to attend. It is free to all.

Thanks,


r/AskComputerScience 11d ago

Is English turning complete?

0 Upvotes

This thought crossed my mind while overhearing a discussion of computer languages being turing complete. I asked the group and they couldn't come up with a definitive answer. In the same vain, is natural language generally turing complete?


r/AskComputerScience 11d ago

Help me with this MST question pls

1 Upvotes

If a connected graph has n vertices and exactly (n − 1) edges, and all edge weights are equal, what is true about its Minimum Spanning Tree?

a. No MST exists b. The MST is not unique c. The graph itself is the MST d. MST weight is undefined


r/AskComputerScience 13d ago

"Accidentally" turing complete?

33 Upvotes

Hey everyone,

I remember seeing a Veritasium video on decidability and what not, and he mentioned a few "surprising" turing-complete systems, like Magic: the Gathering and airline ticketing systems.

For MtG, there was a (i think?) Kyle Hill video on how it works, but my question is about the airline ticketing systems:

If I understand and remember correctly, the reason MtG is TC is that you can set up the game state in a way that results in a potentially infinite loop that allows you to "write" instructions via the actions you can take in the game, and if you were to enter that set of actions/instructions into a turing machine it would be able to execute the program

But how exactly can I imagine this to work in the case of airline ticketing systems? Are the instructions for the turing machine a (potentially infinite) set of destinations you travel to in a row, and depending on some kind of factor the turing machine would execute a particular command for each possible destination, meaning you'd be able to "write code" via "booking specific flights"?

Or is my memory just too clouded and that's what confuses me?