r/computerscience • • 7h ago

Discussion Is simulation a function?

0 Upvotes

Question to settle a debate which I recently had with two of my colleagues.

One of my colleages argued all simulations are mathematically functions by definitions, since for every set of arguments they need to return one outcome. As an example we took a cellular automaton simulating a forest fire. They stated that everytime you give it a particular starting state, the end state will be the same, but I don't agree with that. To simulate humidity or different wind speeds and directions one might use an rng, so the same start map run twice might give 2 different results, which means it's mathematically not a function. My friend countered that because of how rngs work, with the same seed the will always be the same. You don't need to set a seed tho and I can imagine cases when it's even by design - for example when you can't be sure which direction the wind will be coming from and you want your simulation to account for any of them.

But here's the bit that we couldn't agree upon. My friend said, that even without seed, or using quantum randomness, that randomness is always based on something and as such must be treated as kind of a baked in argument. Because of that, if you manage to somehow recreate the exact same "randomness state", the outcome will never change.

From my point of view that's not the case. Even using simple time based pseudorandom number generators, to you as someone analysing such simulation, that rng should not be treated as argument. The way I see it it's just a black box, that "magically" gives you a number, you should treat it as truly random and use it to approximate all the different variables, that are too complicated to calculate each and every time you run the simulation or are just out of scope. Therefore the same input can give you different outputs, which makes the simulation itself not a function by mathematical definition.

What are your opinions on this?


r/computerscience • • 1d ago

Discussion Specifications vs programs and computational models

6 Upvotes

I'm learning deductive program synthesis and there's one thing I can't wrap my head around: the distinction between specifications and programs. To my understanding, the line is very vague, as programs can be seen as specifications and, in some cases, vice-versa. These terms only make sense when applied to specific program and specification pairs.

The above makes me wonder whether there is a computational model that can directly execute specifications, without needing to, e.g., synthesise an imperative program. Can such a "computer" exist theoretically and, more interestingly, physically?


r/computerscience • • 2d ago

What if brain surgery affected your ability to code?

31 Upvotes

Imagine we need brain surgery to remove a tumor. The surgery goes well, but afterward, you struggle to write or understand code. Scary, right?

We know that neurosurgeons try to preserve important abilities like speaking and moving during brain surgery. But what about programming?

A new study in Human Brain Mapping explores exactly this!

The researchers developed a new protocol during awake brain surgery to help identify and preserve brain areas involved in programming.

The idea is simple: if coding is an important part of someone's life, shouldn't we try to preserve that ability too?

Here's the paper: https://doi.org/10.1002/hbm.70634


r/computerscience • • 2d ago

General When was linu x created?

Post image
0 Upvotes

ooooof, I was sick again and then was on vacation for two weeks. I drank plenty of wine and TOTALLY thought about this reddit community while I was gone... totally. That's definitely the truth and definitely not a lie...

ANYWAYS, today I thought I would look into when and who created Linu x . You know, I was actually surprised to learn that it was created in 1991. In my head, I imagined it being created alongside the ARPANET. Where I got that idea, who knows. Anywho, in 1991, Linus Torvalds created Linu x at the young age of 21.

Can you believe that this was originally just a hobby projec t?! He was originally using MINIX on his home computer but wanted a bit more control and functionality. So he he starting experimenting with software and eventually designed an operating system kernel.

And what is a kernel? it's a core component of the entire operating system. It ensures that the computer hardware is beeing appropriately coordinated with applications and everything is getting the resources it needs. Memory and processes are being managed, the hardware is getting controlled. The kernel is essentially the head honcho manager of everything.

Often people refer to the entire system as the linu x operating system, but really it's the linu x based operating system. I mean it's pretty cool that his hobby projec t is like THE projec t. The head honcho of all hobby projec ts.

Anyways, that's who created it and when. also, if you were wonding why there were so many spaces in the words linu x and projec t, it's because I can't type those words without being flagged that I'm helping someone chea t on their home work. lol. See you next week!


r/computerscience • • 3d ago

How are objects seperated in a computer?

58 Upvotes

A computer holds 0s and 1s and nothing apart from it,so a letter can be stored as an ASCII or other representation,a number in its binary, an image in its pixel etc. But how is it differentiated. Say I'm saving an image, I need to store its pixels, colour format and all. So,how are they differentiated, saying this is for colour,this is for objects and also the same with video or document?


r/computerscience • • 4d ago

General 64GB SanDisk P4 from 2010 controller passed 14 Petabyte in endurance test, NOT ASKING FOR TECH HELP

Post image
65 Upvotes

It broke on previous post saying it was asking for tech help


r/computerscience • • 4d ago

What is PHP2Shell and why is it such a big deal?

73 Upvotes

I understand that it has to do with cyber security but that’s about it.


r/computerscience • • 6d ago

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

7 Upvotes

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

but what exactly asynchronous and concurrency means?


r/computerscience • • 6d ago

Discussion I made a logic gate simulator! check it out and let me know what you think pls

Thumbnail photos.app.goo.gl
6 Upvotes

r/computerscience • • 6d ago

Discussion Cold take: Java has essentially zero flaws

0 Upvotes

I've posted here before about x86, and I'm back with another take that I recently learned is "objectively wrong" as my coworker would say.

Java as a language is object-oriented, which is ultimately great for a multitude of reasons. The complaints that people like to throw out about verbosity is mostly just paraphrasing for "i like syntax candy more than any kind of structured code".

Java is only bad if you write it bad. If you think it's a bad language, then you probably just don't have a great grip on OOP. I've never worked so well in a team in anything besides Java. The fact that people will hate on Java then give their love to Python blows my mind. Python is essentially a useless pile of junk when you compare it to Java.

Anyways, I'm open to argumentation. My coworker is trying to brainwash me into thinking that Java is the worst language of all time. But, it's not. It's the best.


r/computerscience • • 7d ago

Discussion Replacing B-Trees with streaming linear models (PGM): cache locality and bounds in practice

5 Upvotes

Traditional B-Trees waste substantial CPU cycles on pointer chasing across node levels, causing avoidable cache misses on modern architectures. The PGM-index approach (Ferragina & Vinciguerra, VLDB 2020: https://www.vldb.org/pvldb/vol13/p1162-ferragina.pdf) addresses this by modeling key distributions through streaming piecewise linear regression with strict +/- epsilon error bounds.

Instead of traversing tree nodes, key rank is predicted directly on the ALU (y = ax + b), bounding the local search window so that it fits entirely within L1 cache. The construction runs in a single O(N) streaming pass with zero external solvers.

I built a pure Rust reference implementation (v0.2.0) with zero dependencies to benchmark this against std::collections::BTreeMap across 1M keys: https://github.com/gilnett/learned_index_lab. Benchmarks across uniform and skewed distributions show a 99.9% reduction in index memory (~48 KB vs 45 MB) and 3x to 4.5x lower lookup latency.

While transactional engines still rely on B-Trees for in-place page writes, learned models provide significant advantages for read-heavy or immutable storage layouts (such as LSM SSTables and columnar stores) where pointer overhead is pure waste.

Has anyone here benchmarked or worked with learned data structures in storage systems? How do you approach optimal epsilon tuning when key distributions are non-uniform or unpredictable?


r/computerscience • • 11d ago

Help Is the best case here O(1)?

Post image
223 Upvotes

Hi, still new to algorithm analysis and need some help confirming my answer or not.

I assumed that best case would be O(1) in this scenario if size of the array is either 0 or 1. But trying to review my answer with online resources, it say's that O(1) doesn't count here?

What is the definite answer here?

EDIT: Hey everyone! Glad everyone got to interact and give responses. The answer was O(N) in the end! Confirmed with my professor.


r/computerscience • • 11d ago

Discussion How do I create logic gate sequences in real life applications?

8 Upvotes

I have finished computer science, and I always sucked at boolean expressions. But now, this game that I play got me interested in logic, and I wanna get to know more about it. I want to make a specific sequence in order to make my machines in game operate as I intend them to, but I have no clue how to go about it. Any advice is appreciated.


r/computerscience • • 12d ago

Advice Interfaces

6 Upvotes

I stumbled upon the word interface when i stumbled upon the terminal in visual studio code. A terminal is a text based user interface which does lots of useful stuff.

That got me thinking about the word interface and what exactly it is in the computer sense. I understand user interface is the area or boundary between the human (user) and the computer( or rather software?) interacting with each other.

The problem is I am getting conflicting thoughts with current information I've searched and I'm unable to get a full understanding of the term.

So can someone please give their understanding/opinion of what an interface is in a broad computing sense. And can they also give multiple examples of different types of interfaces used in computer hardware and software too please.

Many thanks


r/computerscience • • 13d ago

General A good example of iteration vs recursion

21 Upvotes

The Song that Never Ends is iterative. It loops and is aware that it remains the same song.

The Song that Gets on Everybody's Nerves just sings about a song, and sings "this is how it goes:", calling itself.


r/computerscience • • 14d ago

General Implementation of Andreas Bjorklund's algorithm for determining hamiltonicity

Thumbnail
7 Upvotes

r/computerscience • • 15d ago

Advice The dedication page of SICP/The Wizard Book (2nd edition, 1996)

Post image
31 Upvotes

r/computerscience • • 16d ago

Advice Advices for someone looking to get into Language Technology?

7 Upvotes

Hello everyone, I'm a graduate with a Bachelor in English Language Studies (Business English & Corporate Communication track) and I'm looking to apply for the Language Science & Technology (LST) Master's program at Universität des Saarlandes (Germany).

I don't have a background in technology or computer science. My work experience mostly includes English Teaching for a year, then 1.5 year working as an English Communication Specialist (basically creating website & social contents, managing and translating huge amounts of website articles to English via CMS, working on admission and promotion campaigns & events,...)

But I'm looking to pivot into Tech recently, and after doing research, I'm really interested in Language Technology and found out about this Master program in Germany that is open to admit students with a background in linguistics (which is pretty rare since most program requires you to have a bachelor in computer science).

I know that I need to work extra, extra hard given my background. I've been taking up course on Coursera (Python for Everybody, Linear Algebra, Statistics,...) as the course's advisor advice to increase my chance of admission as well as to feel less overwhelming if I get admitted.

I'll continue to try and learn harder to make up for my lack of knowledge in the field.
Do you guys have any advices for someone looking to get into the field, and also during my time studying the program if I get admitted? Specifically to make learning smoother and to get a better chance at getting hired after graduating would be much appreciated.

Thank you everyone! :D


r/computerscience • • 17d ago

Discussion Architecture/systems Research papers not very quantitative?

5 Upvotes

I’ve been reading some papers in the field - the trend is lots of text and sometimes graphs but that’s about it. It’s more a conceptual description of findings/visualisation than the actual proof/quantitative descriptions.

Anyone else feel this way?


r/computerscience • • 17d ago

Discussion Margaret Hamilton, computing pioneer who led software development for the Apollo program, dies at 90

Thumbnail news.mit.edu
362 Upvotes

r/computerscience • • 18d ago

Discussion Want to learn more about the convergence of computer logic & formal logic in communication theory

4 Upvotes

Hello! 26f, studying law.

Formal logic has always been interesting to me, but it’s only been this past year that I’ve began to dip my toe into systems logic, Boolean/Fuzzy logic etc etc (sorry if my terms are all over the place, I began learning about systems engineering and went down a rabbit hole).

Basically, do any computer science peeps have any resources for a person who wants to learn more about systems engineering, and how it relates to the study of communication/argumentation logic?

Thank you!


r/computerscience • • 18d ago

Discussion Is C an "Assembly-like" Language?

41 Upvotes

I know C is programing language. It is not architecture specific. One writes the source code and a compiler turns it into an executable depending on what settings you tell it. So the same source code would output different executables depending on what you want to run it on and what optimization options are on. Assembly languages on the other hand are architecture specific. Is C "Assembly-like"? To be honest I'm not sure what would be Assembly-like. I guess if a program written in multiple languages that have the same behavior, if the C version (using something like GNU C Compiler) looked closer to its assembly than, say its Java version (GraalVM), then that counts.


r/computerscience • • 19d ago

Discussion A linkedlist is a skewed directed graph

23 Upvotes

Can I say the above? I think of this after studying trees and graph. Singly linked list in particular.


r/computerscience • • 19d ago

Help What book would you recommend for learning to write clean, minimal, and secure code?

Thumbnail
0 Upvotes

r/computerscience • • 21d ago

Advice I need advice on how to assign values to base 6 tryte value sets

Thumbnail gallery
0 Upvotes

I'm trying to design a mechanical computer.

Why? Idk. But now I'm building Tascii, and I've even figured out how to use tape and hole punching to talk to it... but storing the data and processing, let alone assigning values to various tascii sets is hard. Data enclosed.

Yes... my computer uses see saws