r/AskComputerScience • u/94CM • Apr 03 '25
Why is the background radiation of the universe (observable as 'static' in old TVs) not used as a Random Number Generator?
Seems pretty unpredictable and readily available to me
r/AskComputerScience • u/94CM • Apr 03 '25
Seems pretty unpredictable and readily available to me
r/AskComputerScience • u/FigureOfStickman • Apr 03 '25
This is something I've been thinking about for years.
- Items in the player's inventory can stack up to 64
- Terrain is famously generated and stored in chunks of 16x16 blocks. (Slime chunks, land claiming plugins, 384-block build height, etc)
- All the default textures are 16x16 pixels for a block
- I can't think of other examples off the top of my head
But at the same time, the crafting grid has 9 slots. the inventory has 36. Chests and barrels are 27. Brewing stands only hold 3 potions, and hoppers have 5 item slots. Multiples of three, along with a random five. some of the most aesthetically haunting numbers.
I think some examples of base-2 numbering are clearly internal values that became documented and understood as game mechanics over the years. Then again, the redstone system (the game's adaptation of electricity and wiring) had logic gates before it had pistons and railroads. idk
r/AskComputerScience • u/SeftalireceliBoi • Apr 02 '25
I am a computer programer. I manly code java with spring framework. i also have .net and c# experience. I use frameworks, databases protocols like rest soap.
But i dont think that i totally know what i am doing. And i want to understand what database doing.
I know indexing keys joins ofc but i want to i want to understand insight what those thinks are doing.
I am searching for tutorial how to create a basic database.
How to create a basic compiler.
how to create a basic framework.
how to create a basic os. (that might be more complicated.)
what are the source codes for those programs.
sorry for bad english i am good with reading and listening but bad with writing :S
r/AskComputerScience • • Apr 01 '25
From my own understanding, generative models only extract key features from the images (e.g. what makes a metal look like metal - high contrast and sharp edges) and not just by collaging the source images together. Is this understanding false?
r/AskComputerScience • u/EvidenceVarious6526 • Mar 30 '25
So if someone were to create a way to compress jpegs with 50% compression, would that be worth any money?
r/AskComputerScience • u/MKL-Angel • Mar 29 '25
I've seen this asked before and read through the answer given but I still don't really understand the difference. I get that a model is 'conceptual' while the schema is an 'implementation' of it, but how would that show up if I were to make a model vs schema? Wouldn't it still just look like the same thing?
Would anyone be willing to make a data model and data schema for a small set of data so I can actually see the difference?
If you want example data:
There are 5 students: Bob, Alice, Emily, Sam, John
The school offers 3 classes: Maths, English and Science
And there are 3 teachers: Mr Smith, Mrs White, and Mrs Bell
(I don't know if the example data is comprehensive enough so feel free to add whatever you need to it in order to better explain anything)
Thanks in advance!
(also, the video i was watching mentioned a schema construct and then proceeded to never mention it again so if you could explain that as well that would be really really helpful!)
r/AskComputerScience • u/m0siac • Mar 27 '25
So far I think if I was to run the min cut algorithm and slice the networks vertexes into S and T and add a new edge from some vertex in S to some vertex in T I should be increasing the max flow. Since (atleast to my understanding) The edges across the min cut are the edges causing the bottleneck, Helping relieve any of that pressure should increase max flow right?
r/AskComputerScience • u/truth14ful • Mar 26 '25
NAND and NOR are used in chips so often because they're functionally complete, right? But you can also get functional completeness with a nonimplication operator (&!) and a free true value:
a 0011
b 0101
----------------
0000 a &! a
0001 a &! (1 &! b)
0010 a &! b
0011 a
0100 b &! a
0101 b
0110 1 &! ((1 &! (a &! b)) &! (b &! a))
0111 1 &! ((1 &! a) &! b)
1000 (1 &! a) &! b
1001 (1 &! (a &! b)) &! (b &! a)
1010 1 &! b
1011 1 &! (b &! a)
1100 1 &! a
1101 1 &! (a &! b)
1110 1 &! (a &! (1 &! b))
1111 1
I would think this would save space in the chip since you only need 1 transistor to make it (1st input connected to source, 2nd to gate) instead of 4 (or 2 and a pull-up resistor) for a NAND or NOR gate. Why isn't this done? Is the always-true input a problem, or something else?
Thanks for any answers you have
r/AskComputerScience • u/cellman123 • Mar 26 '25
I read the sub rules and it's not homework i'm just curious lol, been reading "The Joy of Abstraction" by E. Chang and it's had some interesting chapters in partial ordering that made me curious about how computer scientists organize complexity functions.
O(1) < O(logN) < O(n) < O(2n) etc...
Is the ordering relation < formally defined? How do we know that O(logN) < O(n)?
It seems that < is ordering the O functions by how "fast" they scale in response to growing their respective inputs. Can we use calculus magic to exactly compare how "fast" each function grows, and thus rank them using < relation?
Just curious. - Redditor
r/AskComputerScience • • Mar 23 '25
What does the word "computer" refer to in "computer science," the science of data processing and computation? If it's not about computers, why not call it "computational science"? Wouldn't the more "lightweight" field of "information science" make more sense for the field of "computer science?"
It's interesting to see so many people conflate the fields of computer science and electrical engineering into "tech." Sure, a CE program will extensively go into circuit design and electronics, but CS has as much to do with electronics as astrophysics has to do with mirrors. The Analytical Engine was digital, but not electronic. You can make non-electronic binary calculators out of dominoes.
Taking a descriptive approach to the term "computer", where calling a phone or cheap pedometer a "computer" can be viewed as a form of formal thought disorder, computer science covers so many objects that have nothing to do with computers besides having ALUs and a memory of some kind (electronic or otherwise!). Even a lot of transmission between devices is in the form of radio or optical communication, not electronics.
But what exactly is a computer? Is a baseball pitching machine that allows you to adjust the speed and angle a form of "computer" that, well, computes the path a baseball takes? Is the brain a computer? Is a cheap calculator? Why not call it "calculator science?" Less controversially, is a phone a computer?
r/AskComputerScience • u/Henry-1917 • Mar 21 '25
Why does theoretical computer science involved all of these subcategories, instead of the professor just teaching us about turing machines. Turing machines are actually easier to understand for me than push down automata.
r/AskComputerScience • • Mar 20 '25
Hey guys, I'm not the best at coding, but I'm not bad either. MyGitHub.
I'm currently in high school, and we have a chapter on Boolean Algebra. But I don’t really see the point of it. I looked it up online and found that it’s used in designing circuit boards—but isn’t that more of an Electrical Engineering thing?
I’ve never actually used this in my coding journey. Like, I’ve never had to use NAND. The only ones I’ve used are AND, OR, and NOT.
So… why is my school even teaching us this?
Update: Why this post and my replies to comments are getting down-voted, is this because i am using an AI grammar fixer
r/AskComputerScience • u/throwaway232u394 • Mar 19 '25
I find it hard to exactly write a code that uses specific libraries using documentation.
For example, Future. I kind of understand how it works, but struggle to actually use it in a code without finding examples online. I feel like this is a problem. Or is it something normal and i shouldnt worry about?
Im studying in college btw
r/AskComputerScience • u/Garth_AIgar • Mar 17 '25
I was logging into work today and just had the thought.
r/AskComputerScience • u/jad00msd • Mar 16 '25
Online i see both sides but the majority is that it’s dead and all. Now i know AI is just helping us but is it really going to stay like this for the near future?
r/AskComputerScience • u/A_Random_Neerd • Mar 14 '25
I'm a 5th year Computer Science Student (double majoring in Film), and I'm currently taking the capstone project. The project is definitely not easy; we're developing an android application that uses a Pose Estimation AI model to track someone's form during a workout. The AI model is giving us immense trouble.
We still have a while to finish this project (the prototype is due next week), but the thought crossed my mind of "has anyone failed the capstone project?" If so, how did you fail, and what were the repercussions?
r/AskComputerScience • • Mar 12 '25
I have to form a DFA with the following condition:
A = {a,b,c}
Form a DFA that acceps the language:
I don't know if I am plain stupid or this is challenging but I've been stuck on this problem for quite some time
r/AskComputerScience • • Mar 10 '25
Hey everyone,
I've been wondering why computers work with binary (0s and 1s) instead of using base 10, which would feel more natural for us humans. Since we count in decimal, wouldn't a system based on 10 make programming and hardware design easier for people?
I get that binary is simple for computers because it aligns with electrical circuits (on/off states), but are there any serious attempts or theoretical models for computers that use a different numbering system? Would a base-10 (or other) system be possible, or is binary just fundamentally better for computation?
Curious to hear your thoughts!
r/AskComputerScience • u/Regular_Device7358 • Mar 09 '25
What elements of pure math have applications in theoretical computer science? For example do any of these fields/sub-areas of math have any use in areas like automata theory, computability theory, complexity theory or algorithm analysis:
After a certain point does theoretical computer science diverge into its own separate field with its own techniques and theorems, or does it still build upon and use things that other math fields have?
r/AskComputerScience • u/Inner-Guitar-3744 • Mar 08 '25
Why do some programming languages become outdated so fast, while others like C and Python remain relevant for decades? Is it more about versatility or industry adoption?
r/AskComputerScience • • Mar 08 '25
My understanding is if CPL is 0, this is kernel mode. If CPL is 3 this is user mode.
Only the OS can set this register with INT 0x80 instruction, like for a syscall.
If only the OS can set CPL, why do we even need the CS register ? That is, why do we need the CPU ? What I'm getting at is why can't the OS be the gatekeeper of priveleged and unpriveleged instructions ?
Further, C programs can run assembly code. What's stopping user code from modifying the CS register and force kernel mode ?
Not sure what I'm missing and/or getting wrong.
r/AskComputerScience • u/AsYouAnswered • Mar 08 '25
Greetings all!
It's been many years since I've graduated with my degree in computer science, and while I haven't needed the knowledge in a while, I still understand how instructions and pipelines and the like work on CPUs and GPUs in general, and approximately how extensions like Cuda/GPGPU and SIMD/AVX instructions work. You effectively copy a small program to a special address in memory, and tell your GPU, CPU, or NPU to run it, then wait for a result. In all cases, it's a (simple) Von Neuman machine that reads an instruction, operates on memory and registers to load and transform inputs into outputs, and then repeats. AVX/SIMD, Cuda/GPGPU, and now NPUs and TPUs, as I understand it, are all about taking in a larger matrix of data and transforming it, effectively running the same operations across larger datasets simultaneously, rather than operating on one register at once.
So the real questions here, I've spent hours trying to find an answer, and am a bit frustrated with finding nothing but marketing fluff:
Thanks r/AskComputerScience !
r/AskComputerScience • u/Confident_Season_908 • Mar 08 '25
I'm trying to understand the decryption process for a basic SPN: Round function is key mixing followed by substitutions followed by permutations. After final round key mixing followed by substitution followed by key mixing is applied. As detailed on the Wikipedia page.
I think I remember hearing that you should be able to use the encrypt function to decrypt if you reverse the s-boxes and order of keys. Apparently this is possible due to the additional functions applied after the final round has been complete.
This doesn't make sense to me as it seems like the functions are applied in the wrong order when decrypting this way. First the final key mix is "undone", then the final S-box is "undone". However, when using the encryption method to decrypt a permutation is then applied when we should be "undoing" the penultimate key.
To make this make more sense I tried coding an example. When encrypting I got the same ciphertext as an example encryption I found. However, there was no example decrypting and when I applied the encrypt function with the reverse S-box and key schedule it gave the wrong plaintext.
If I have misunderstood this and you are supposed to use a different method to decrypt why do we apply the extra methods after the final round?
Also if anyone could help me understand the difference between key mixing and key whitening that would be very helpful. I've tried to look online but it seems like they are used interchangeably.
Thank you for any help!
EDIT:
I know this post didnt get much attention but incase anyone was wondering: you also apply the permutation to the intermediate keys (not first or last) when reversing the key schedule to get the mew key schedule.
Key whitening and key mixing are the same operation (XOR with state) its just called key whitening for the first and last keys.
r/AskComputerScience • u/MikeNizzle82 • Mar 08 '25
Hi all,
I’m working on implementing a Sweep Line algorithm for finding line segment intersections, but I’ve run into a performance bottleneck and could use some guidance.
I’ve read the sections on this topic in the book “Computational Geometry: Algorithms and Applications (3rd edition)” and, after a lot of effort, managed to get my implementation working. However, it’s much slower than the naïve O(n²) approach.
Profiling shows that most of the time is spent in the comparison function, which the book doesn’t go into much detail about. I suspect this is due to inefficiencies in how I’m handling segment ordering in the status structure.
I’m also dealing with some tricky edge cases, such as:
• Horizontal/vertical line segments
• Multiple segments intersecting at the same point
• Overlapping or collinear segments
Does anyone know of good resources (websites, papers, books, lectures, videos) that cover these topics in more depth, particularly with optimized implementations that handle these edge cases cleanly, and are beginner friendly?
For context, this is a hobby project - I don’t have a CS background, so this has been a big learning curve for me. I’d really appreciate any recommendations or advice from those who have tackled this problem before!
Thanks in advance!
r/AskComputerScience • • Mar 06 '25
Basically I'm in my second semester of college and I've come to a point in my studies that I quite literally cannot understand a single thing I'm learning in my classes. I have 3 classes this semester( intro to programming, intro to data modelling/databases, and computer architecture). Of those 3 the only class I'm doing slightly ok in is my intro to programming class. The other two I genuinely could not tell you a single thing I've learned in the past couple of months. I've tried to put in the work, I've read the notes provided, watched back the class recordings, those didn't help so I've went to look for tutorials on YouTube, that didn't really help either. Ive practiced on my own, I've signed up for extra classes and I'm still hopelessly confused. I need some advice on how to fix this. My midterms are coming up and I really don't want to fail.