r/AskComputerScience • • Jan 02 '25

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

15 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!

109 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 • • 5h ago

Hanoi's recursion not making sense

5 Upvotes

So I'm in the second year of my CS degree and doing DSA, now we have to understand Tower Of Hanoi, I studied the game, studied the trace diagrams, looked up multiple tutorials for it, I get what the program but I don't at the same time. I get how it arrives at the minimum but I think if you gave me a problem to solve via recursion I'd be stumped, I understand how this specific of recursion works but I don't know how I would...make it? If you asked me to create a Hanoi algorithm or any recrusive algorithm recursively I won't be able to but at the same time I understand somewhat how they work?


r/AskComputerScience • • 19h ago

why is comparison sorting stuck at n log n but counting sort gets away with O(n)

3 Upvotes

i get the decision tree argument for why any comparison sort needs log2(n!) comparisons, which is about n log n. but then counting or radix sort does it in linear time and people just say it's cheating because it isn't comparing.

what i can't figure out is whether that's a real escape or just hiding the cost somewhere. like radix sort is O(d*n) but d is basically log of the max value, so for n distinct keys isn't it back to n log n anyway?


r/AskComputerScience • • 8h ago

Guys, how do AI stuff works?

0 Upvotes

I'm kinda smart for a lot of things and thought AI was one of these thing but apparently it evolved too fast and I lost the line of understanding it almost automatically and now am a bit lost on the AI train.

So here it goes: what exactly is a model? is a LLM a type of AI or one of the stuff AI can do? what exactly is a token? how can AI run locally if it needs those tokens? what is an agent/how does it works? what is a harness? why the agent needs a harness?

I've been researching this subjects but only came across stuff that looks too advanced for my level to understand.

Thanks :)


r/AskComputerScience • • 1d ago

ELI5: Why does AI need terabytes of data from millions of books, articles to get 'PhD levels of intelligence' when human PhDs don't?

2 Upvotes

PhDs don't necessarily correlate to intelligence but it is used for a short hand for being highly knowledgeable. Humans with Phds, didn't need terabytes or even hundreds of gigabytes to get their degrees even if it is one field, so why does AI need that much data? Humans with PhDs don't need to read millions of books and they manage just fine. Even simpler models from a few years ago needed a lot data for their capabilities relative to humans.


r/AskComputerScience • • 1d ago

Can I argue that a Breadth-First tree search has a worst-case scenario time complexity of O(b^m) where m is the deepest possible level of a goal node?

2 Upvotes

I got a question wrong in an exam that asked which algorithmic search has a time complexity equal to O(b^m) and two of the options were Depth First Search and Breadth First search. I foolishly picked BFS when I can see clearly DFS is a correct answer. But I'm not sure my logic for picking BFS is actually wrong in this instance. Yes BFS has a time complexity of O(b^d) in all cases where d is the shallowest goal node but in the worst case scenario for BFS wouldn't d=m by necessity? As BFS checks level by level the worst case scenario for BFS is when d=m? So it would have a time complexity O(b^m) = O(b^d) where the worst case specifically is proportional to the total depth of the tree?


r/AskComputerScience • • 2d ago

What does it mean for my CPU to have "AI integration" on an architectural level? Is it just a marketing buzzword?

13 Upvotes

I bought my current laptop about 2 years ago, around when LLMs were getting major press for the first time. A big thing in the marketing of the laptops I was looking at was that the intel CPUs had "AI integration". I didn't think much of it at the time, but i've since taken a computer organization course, and it's led me to think back on this phrasing.

It seems to me, from what I know about CPU design, that LLMs are too complex of algorithms to be integrated into something like branch prediction, and perceptrons and neural nets in control flow prediction aren't a new technology by any means so it would be odd to advertise that as some kind of new "AI". I'm wondering if it could refer to some kind of coprocessor designed to more efficiently do math relevant to LLMs, or if there really is some kind of new predictive architecture intel is utilizing in their chips?

I also wouldn't be surprised if it's all just marketing to cache in on "AI" as the new hot buzzword.


r/AskComputerScience • • 2d ago

Guarantee of Correctness of a Distributed Arbitration Circuit in a real computer

2 Upvotes

Hamacher's "Computer Organisation" book introduces the concept of distributed arbitration when talking of which DMA controller would currently have access to the bus. It uses a 4-bit circuit and demonstrates the system with two devices A and B with ID 5 (0101) and ID 6 (0110). The arbitration code is a bitwise OR of all device IDs (0111 at this point). The arbitration lines are all default LOW (they assert zero when no line is driving it HIGH)

Ideally, we start from the MSB of both IDs and whenever a bit from a device disagrees with the arbitration code, it stops driving that bit and all bits after that. In our case, Device A would become 01XX and the arbitration code becomes 0110 and therefore ID 6 wins the race.

My issue is about synchronization. Do we NEED some sort of synchronization method(where each device checks a specific bit at the same time) to guarantee correctness of this circuit? I have been trying to look for edge cases when differences in synchronisation lead to a wrong device winning the race.

For example, in out previous example. if device B checked its bits before device A had a chance, device B would update its signal to 011X. This makes the arbitration code become 0111. Then device A looks at this arbitration code and updates its signals to 01XX. This changes the arbitration signal to 0110, and ID 6 wins the race. How does one go about proving correctness regardless of synchronisation when generalising this to some N number of devices and some B number of ID bits?

I do not have much experience in electronics, but as a more general question, is there a way to tell when a system (hardware especially) needs synchronisation in general. For software, it feels very intuitive, we assume no guarantees about order of execution and use locks whenever needed, but hardware feels a lot more trial-and-error.


r/AskComputerScience • • 2d ago

Computer Networks : Need Help

6 Upvotes

I have a Computer Networks course this semester and I am finding it difficult to understand. It is not that the concepts are difficult, I am just finding it hard to make a mental model of where every single thing fits. it is not like i am failing the course. Till here i have been able to handle the course. but what is the point of getting good grades when you don't even understand where each thing fits ?
From the very bottom layer to the top level, where DNS comes (where it is stored), how IP's even works, UDP, TCP, QUIC, tables, DNS chain, masks, subnets or even IP's. I know what they are, but i don't know where they are and how they interact.

Can anyone please suggest some resources, more like an animated video where i can visualize it ? Cisco Packet tracer didn't help much.


r/AskComputerScience • • 3d ago

why is hashing a string O(n) if we say hash table lookup is O(1)

26 Upvotes

every intro course says dict lookup is O(1) average, but you have to hash the key first and hashing a string means going through every character, so isn't it really O(length of key)?

is the O(1) just assuming keys are a fixed size, or is there some other reason we ignore that. kinda confused how people are comfortable calling it constant


r/AskComputerScience • • 2d ago

What is the difference between decomposition by business capabilities and decomposition by subdomain?

1 Upvotes

What is the difference between decomposition by business capabilities and decomposition by subdomain?
i mean what is domain in this? i am unable to differentiate between these two techniques (by business capabilities vs by subdomain)


r/AskComputerScience • • 3d ago

How Does ZIP Store Directories?

5 Upvotes

I'm reading the pkware documentation on the ZIP file format and I get how file data is structured, but I don't see where it says how the ZIP file saves directories.

Edit: Nvm I'm stupid. A file's relative path is stored in the file name section of the file header.


r/AskComputerScience • • 3d ago

Tips on getting up to speed on technical side of search product

2 Upvotes

I own a domain-specific dataset, and I depend on horizontal teams to deliver platform capabilities like search, alerts, notifications, dashboards, and whatnot.

The data itself is structured data that we're buying from a vendor, and the integration work is something I own. It's a pretty large dataset, about 150 million records.

I need to work with our horizontal search team to make this dataset searchable. My responsibility is to provide the requirements, define the user experience, write user stories, and work with the search PM and their tech lead to discuss technical trade-offs.

Before I go into these meetings, I'm trying to figure out what I should know or put together beforehand. More specifically, what search-related technical knowledge should I gain so that I can have meaningful discussions with the team and understand the trade-offs they're making?

I know I can ask ChatGPT o rClaude to help me learn these concepts, but I'd also like to hear from search PMs or other PMs who have worked with similar dependencies.

How did you get up to speed on search and its underlying systems? What topics or concepts, like precision, recall, indexing, ranking, etc., should I familiarize myself with before engaging with the horizontal search team?


r/AskComputerScience • • 4d ago

Is it possible for two systems that have never communicated before to negotiate a protocol that effectively lets them do so?

16 Upvotes

I read once that Xerox was working on a way to do that, but I don't know how much that was just hype.


r/AskComputerScience • • 4d ago

How do I reach the level of knowledge, where I can point to any part of my screen and say "Oh, I know how that's implemented"?

31 Upvotes

I know programming, obviously, however I don't know much about the operating system. Most people can make apps within an environment, but most of us don't know anything beyond that

I want to deeply understand how the computer I'm using works, even just the software part

If you go on a virtual tour of your computer, like browsing the file system, or even looking at the plain old desktop, there's so many endless things in front of you, that most people have no idea how to make

How do I make a Windows desktop app? Why does it run on Windows? Same for MacOS

How do tab sizes work?

What is the desktop "screen" and why can I click and drag my mouse to highlight the icons? Where are those icons stored?

I can code a website, but I don't know a clue about how the browser works

How do I make a file system? I mean, isn't it just a large data structure, and I know data structures, so I'm sure I can learn it

Why does my task bar pop up when I drag my mouse all the way to the bottom of the screen?

What does it mean to turn on a computer?

Why / how does my physical mouse control my cursor? Is there a way I can "hack" my mouse? How do I code the firmware in my mouse?

How does the OS accept and eject USBs?

How do you allow your OS to connect to wifi?

What really is a .txt, .pdf, .rar .zip? Why can some OS's open them, some cannot?

Stuff like that

Can most of you point to any part of the screen and know how it works?


r/AskComputerScience • • 4d ago

Is Anthropic stupid?

0 Upvotes

I just saw a headline titled “Anthropic warns self-replicating Al 'worms' could spread across smart devices by end of 2026”. I read a bit more into it and I don’t understand why they won’t just stop? Like if they’re the one creating it then why don’t they stop?


r/AskComputerScience • • 5d ago

I need help translating this flyer!

2 Upvotes

I found this flyer in a stairwell where I live. It has binary on it and a date, but every translator I’ve tried to enter it into has just given me “Can you r.” I assume it says something like “Can you read this,” but I don’t know. Here’s what I could transcribe and the flyer: 01000011 01100001 01101110 00100000 01111001 01101111 01110101 00100000 01110010


r/AskComputerScience • • 5d ago

Questions about Big O notation

9 Upvotes

I was studying data structures and algorithms and I wondered, If we have asymptotically positive functions f(n) and g(n) and increasing asymptotically positive function h(n) such that f(n)=O(g(n)) is it safe to assume h(f(n))=O(h(g(n))) ?

Is it always the case or it just works with some specific functions?

another question I have is if we have f(n)=O(h(g(n))) can we assume f(n)=h(O(g(n))) ?


r/AskComputerScience • • 6d ago

Confused between partitioning and sharding in databases😭

6 Upvotes

I'm studying DBMS and I'm confused about the difference between partitioning and sharding.

From what I understand, partitioning means dividing a large table into smaller parts. For example, splitting a table of 100k rows into 50k, 30k and 20k rows.

Now, if I store these three parts on three different servers, is it called sharding or just partitioning? Since partitioning isn't necessarily restricted to one server, the terms seem to overlap.

Also, if sharding is a type of partitioning, why is sharding defined as dividing data into smaller parts again? Wouldn't the data already be divided during partitioning, with sharding simply distributing those parts across multiple servers?

Basically, is partitioning the general concept and sharding the same concept specifically used in distributed systems? Or am I missing something?


r/AskComputerScience • • 7d ago

Why classic Subspace Constrained Mean Shift (SCMS) trajectories miss the static density ridge (and a dynamical systems fix)

5 Upvotes

While reviewing some nonparametric manifold learning methods for high-dimensional feature spaces, I came across a recent paper (http://arxiv.org/abs/2608.05112v1) that re-examines the convergence properties of the Subspace Constrained Mean Shift (SCMS) algorithm.

For a long time, the common assumption in the literature has been that SCMS trajectories converge directly to the classical "static ridge" defined by the density gradient and the eigenvectors of the density's Hessian matrix. However, this paper demonstrates that this assumption doesn't hold in general because the static definition completely ignores the rotation of the trailing eigenspace along the continuous flow of the underlying vector field.

To address this gap, the authors introduce a dynamical systems perspective, defining a new structure called the "stable ridge" using the Jacobian of the projected density gradient. They prove that this stable ridge is actually the true theoretical convergence target of SCMS, rather than the traditional static definition.

They also propose a generalized framework using a constant step size, which achieves uniform R-linear convergence, and show that the original formulation suffers from polynomial-time computational bottlenecks due to implicitly coupling the step size to the smoothing bandwidth via the Mean Shift operator.

That said, one limitation I noticed while reading through the proofs is that the analysis assumes certain smoothness conditions on the underlying density estimator that might be difficult to verify or guarantee in practice with sparse, noisy, high-dimensional empirical datasets.

Curious if anyone here has run into similar convergence or subspace rotation issues when applying mean shift or gradient-based ridge estimation techniques to complex real-world manifolds?


r/AskComputerScience • • 8d ago

Why are recent graduates of Computer Science and Computer Engineering facing a higher unemployment rate of 7% and 7.8% respectively compared to the natural rate of unemployment of 4.2%?

88 Upvotes

Overall unemployment rate of recent graduates is also 5.7%

Source: NY Fed recent labor market outcomes by major and unemployment.


r/AskComputerScience • • 8d ago

Why doesn't the computer just wipe actual files the same way it deletes file pointers?

19 Upvotes

I understand that deleting a file usually just removes its pointer or metadata, leaving the actual data there until it gets overwritten. But since the pointer is just data too, why can't the computer just wipe the actual file right away?


r/AskComputerScience • • 8d ago

Hi can anybody explain me the difference between asynchronous, concurrency and parallelism?

6 Upvotes

Parallelism i understand that Performing multiple tasks parallely at the same time

but what exactly asynchronous and concurrency means?


r/AskComputerScience • • 9d ago

Data engineering vs Embedded systems vs software architecture vs Compiler Engineering

4 Upvotes

​

Which one is the best from your perspective? For me, those options are somehow resistant in this AI context.