Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Matsozetex

Member
  • Content Count

    47
  • Joined

  • Last visited

Awards


This user doesn't have any awards

1 Follower

About Matsozetex

  • Title
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Matsozetex

    Need help with python approximation of pi

    Oh, I already know about the code for input validation. But as you said, since I know there is no input validation, and I will be the one using it, there is no need. Heck, if it doesn't run I'll exactly know why, because my stupid self had fat finger syndrome. Update: I got all four things working: from math import pi from math import sqrt percision = float(input("Enter the percision for the calculation: ")) def basel(percision): basel_result = 0 basel_term = 0 basel_total = 0 base_list = [] while basel_total <= (pi - percision): basel_term = basel_term + 1 basel_result = (1/(basel_term**2)) base_list.append(basel_result) basel_total = sqrt((sum(base_list)) * 6) return(basel_total, basel_term) print(basel(percision)) def wallis(percision): wallis_result = 1 wallis_total = 0 wallis_term = 0 while wallis_total <= (pi - percision): wallis_term = wallis_term + 1 wallis_result = wallis_result *((2 * wallis_term) * (2 * wallis_term)) / ((2 * wallis_term - 1) * (2 * wallis_term + 1)) wallis_total = wallis_result * 2 return (wallis_total, wallis_term) #print(wallis(percision)) def taylor(percision): taylor_result = 0 taylor_total = 0 taylor_term = 0 if taylor_total * 4 != (pi-percision): while True: taylor_term += 1 print(taylor_term) taylor_result = taylor_result + ((-1)**(taylor_term + 1)) * (1/(2*taylor_term-1)) print(taylor_result) taylor_total = taylor_result * 4 if taylor_term != 1 and round(pi - taylor_total, (len(str(percision).replace('.',''))) -1) == -1 * percision: #take the length of str(percision), remove the decimal point and -1 to remove counting the 0 break #required as the first erm of taylor algorithim total would be 4 and would instantly end the function return(taylor_total,taylor_term) #print(taylor(percision)) def spigot(percision): spigot_result = 0 spigot_total = 0 spigot_term = 0 spigot_past = 1 spig_count = 1 nat_list = [] fib_list = [1, 1] result_list = [] while spigot_total * 2 <= (pi - percision): nat_list.append(spigot_term+1) #creates list of natural numbers, including 0 fib_list.append(fib_list[spigot_term]+fib_list[spigot_term+1]) #creates list of fibonnaci squence spigot_result = spigot_past * (fib_list[spigot_term]) / ((nat_list[spigot_term]* 2 -1)) result_list.append(spigot_result) spigot_term +=1 spigot_past = spigot_result spigot_total = sum(result_list) if round(pi - spigot_total *2, (len(str(percision).replace('.',''))) - 1) == -1 * percision: break return(spigot_total * 2, spigot_term + 1) #print(spigot(percision)) The last one was a PITA, the numerator is a Fibonacci sequence and the denominator is a list of natural numbers.
  2. Matsozetex

    Need help with python approximation of pi

    import math pi = float(math.pi) percision = float(input("Enter the percision for the calculation: ")) base_list = [] def basel(percision): basel_result = 0 basel_term = 0 basel_total = 0 while basel_total <= (math.pi - percision): basel_term = basel_term + 1 basel_result = (1/(basel_term**2)) base_list.append(basel_result) basel_total = math.sqrt((sum(base_list)) * 6) return(basel_total, basel_term) print(basel(percision)) This is what I have made, and it works, flawlessly. If it looks good then good, if my code looks like spaghetti is there any tips/conventions that you can offer me. Also I will insert comments after I finish my other 3 approximations (internal sadface).
  3. Matsozetex

    Need help with python approximation of pi

    Would it be a wise move to use a "while" loop with the conditions of the "if" statement instead of the for loop. As the output of the function has to be the number of terms to approximate pi. For example, if the input is the precision of (0.1) then it should output (approximation to such precision, basel_terms).
  4. I am writing a program to approximate pi using different methods, I am on my first method, Basel problem which comes in the following notation: pi2/6 = 1/1 + 1/4 + 1/9 + 1/16 + 1/25 My code is a function: import math percision = float(input("Enter the percision for the calculation: ")) def basel(percision): basel_result = 0 basel_total = math.sqrt(basel_result * 6) basel_term = 0 for basel_term in range(1, basel_term): if math.sqrt(6* basel_result) < math.pi(percision): #loop keeps adding until the result is within the accuracy value of pi basel_term = basel_term + 1 basel_result = basel_result + 1/basel_term**2 return(basel_total, basel_term) print(basel(percision)) However, every time I enter the percision value (say 0.1) it returns the output (0.0, 0). What am I doing wrong?
  5. Matsozetex

    AMD Radeon VII Benchmark/Launch Mega Thread

    Indeed.
  6. Matsozetex

    AMD Radeon VII Benchmark/Launch Mega Thread

    Yeah for some reason AMD software allows for power target to be pushed to 150% vs 120% from NVidia. It kinda sucks for AMD because a lot of the hysteria surrounding Vega power draw was when overclocking with 150% PT benchmarks where shown, their own act to make to increase liberties in their software led to (I am assuming here) lower sales due to rumors or misinformation.
  7. Matsozetex

    AMD Radeon VII Benchmark/Launch Mega Thread

    I know this may be unrelated, but the Seasonic Focus Plus series of the PSU had an issue with V56/64 cards, I guess not anymore. Gosh, its so ridiculous to look at the Vega peak draw compared to its competitors.
  8. Matsozetex

    Can someone explain OCP to me?

    Not 6+2 but 8 to 2x8 pin converters.
  9. Matsozetex

    Can someone explain OCP to me?

    No its just a hypothetical as I have seen a lot of people say if the wattage of the power supply can support the graphics card, then using splitters is alright. Realizing that now and a bit of googling the 8pin has a 150W max while the 6pin has a 75W max. I've seen his comments, fair to say that he has convinced the entire internet to not buy it. I knew about the OTP and cross load but since I wasn't sure about OCP, I wasn't sure about its OCP issue.
  10. Matsozetex

    Can someone explain OCP to me?

    So this is why the S12/M12 is shunned.
  11. Matsozetex

    Can someone explain OCP to me?

    So say if some 'smart person' tried to power a Vega 64 with a single 8 pin using splitters the wires would melt/be damaged and the power supply wouldn't to jack?
  12. Matsozetex

    Can someone explain OCP to me?

    The logic behind how it operates, triggers and some example scenarios please.
  13. I've been trying to understand how OCP works, I've read through JG's articles and Toms PSUs 101 but still have trouble grasping the logic of it. For example, the Corsair CX650M has 54A on its single 12v rail but wouldn't the OCP trip at 20A (240VA at 12v) or does OCP trigger when someone is trying to pull more power than a cable is specified to handle (i.e An 8 pin from the PSU to a splitter in a 1080ti). Do single rail PSUs even need OCP? Help. I am confused, complicated and detailed answers are welcome.
  14. Matsozetex

    Experiences with non-techies

    Yeah I've dabbled back into modded minecraft, too bad my bud is a Minecraft purist (Basically hates all tech/tech-magic mods except for old industrial craft). Also hates SkyBlock
  15. Matsozetex

    Experiences with non-techies

    When I was young I used to play modded Minecraft on my old laptop. The laptop was having issues playing the game, I googled for an hour and realised the model of laptop has only 2GB of RAM. I asked my father, who works in IT to upgrade the memory, he put in a 4GB SD card. Placebo effect worked for 60 seconds and resorted to playing AoE2. Good times.
×