r/learnprogramming • • Apr 05 '22

Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them

Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.

Someone else who reads yours and does understand it, try to explain it to them to help them learn

1.6k Upvotes

738 comments sorted by

View all comments

22

u/Herpnasty11 Apr 05 '22

Quantum computer as a whole lol

6

u/hehehuehue Apr 05 '22

WIRED has a really good video on this

TLDW: Imagine a coin spinning constantly and not landing on either heads or tails, compared to binary where a coin MUST be either heads or tails.

6

u/evinrows Apr 05 '22 edited Apr 05 '22

But how do you solve a problem with that technology?

I know the answer is "something something every combination of people solutions at the same time," but at some point you have to collapse the quantum state. So how/when do you do that such that you get useful information back?

8

u/DONT_HACK_ME Apr 06 '22

You use algorithms that slightly change the system (but not collapse it) so that when you do measure the system, collapsing it, the correct solution is much more probable to be found than the incorrect solution.

Then you run the algorithm several times to verify what the correct solution was.